작성일 : 13-02-14 11:13
|
[ASP] 전화번호 (-) 하이픈 추가 ASP
|
|
|
글쓴이 :
조형래
 조회 : 4,062
|
if srchKeyword <> "" then ' 전화번호 자동 하이픈 추가 로직
Select Case Len(srchKeyword)
Case 8 '1588-xxxx
t1 = Mid(srchKeyword,1,4)
t2 = Mid(srchKeyword,5,4)
srchKeyword2 = t1 & "-" &t2
Case 9 '02-xxx-xxxx
t1 = Mid(srchKeyword,1,2)
t2 = Mid(srchKeyword,3,3)
t3 = Mid(srchKeyword,6,4)
srchKeyword2 = t1 & "-" &t2 & "-" &t3
Case 10 '휴대전화 011-xxx-xxxx
If Mid(srchKeyword,1,2) = "01" Then '휴대전화 010-xxx-xxxx
t1 = Mid(srchKeyword,1,3)
t2 = Mid(srchKeyword,4,3)
t3 = Mid(srchKeyword,7,4)
srchKeyword2 = t1 & "-" &t2 & "-" &t3
Else '일반전화
If Mid(srchKeyword,1,2) = "02" Then
t1 = Mid(srchKeyword,1,2)
t2 = Mid(srchKeyword,3,4)
t3 = Mid(srchKeyword,7,4)
srchKeyword2 = t1 & "-" &t2 & "-" &t3
Else
t1 = Mid(srchKeyword,1,3)
t2 = Mid(srchKeyword,4,3)
t3 = Mid(srchKeyword,7,4)
srchKeyword2 = t1 & "-" &t2 & "-" &t3
End If
End If
Case 11 'xxx-xxxx-xxxx(휴대전화,070)
t1 = Mid(srchKeyword,1,3)
t2 = Mid(srchKeyword,4,4)
t3 = Mid(srchKeyword,8,4)
srchKeyword2 = t1 & "-" &t2 & "-" &t3
Case Else
srchKeyword2 = srchKeyword
End Select
end if
|
|