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  

posted on 2008-02-02 14:54  路大侠  阅读(197)  评论(0)    收藏  举报

导航