`

javascript全角半角转换

 
阅读更多
Function strConv(strCommix,intState)
Dim strChar
Dim intAsc
Dim strTmp

If intState = 0 Then
For i = 1 To Len(strCommix)
strChar = Mid(str1, i, 1)
intAsc = Asc(strChar)
If (intAsc>=-23648 And intAsc<=-23553) Then
strTmp = strTmp & Chr(intAsc+23680)
Else
strTmp = strTmp & strChar
End if
Next
Else
For i = 1 To Len(strCommix)
strChar = Mid(str1, i, 1)
intAsc = Asc(strChar)
If (intAsc>=32 And intAsc<=127) Then
strTmp = strTmp & Chr(intAsc-23680)
Else
strTmp = strTmp & strChar
End if
Next
End If
strConv = Trim(strTmp)
End Function
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics