龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp编程 >

asp 中英文字符长度检测判断函数

时间:2012-12-31 22:56来源:未知 作者:admin 点击:
分享到:

asp 中英文字符长度检测判断函数

function strLength(str)
       ON ERROR RESUME NEXT
       dim WINNT_CHINESE
       WINNT_CHINESE    = (len("论坛")=2)
       if WINNT_CHINESE then
          dim l,t,c
          dim i
          l=len(str)
          t=l
          for i=1 to l
             c=asc(mid(str,i,1))
             if c<0 then c=c+65536
             if c>255 then
                t=t+1
             End if
          next
          strLength=t
       else
          strLength=len(str)
       End if
       if err.number<>0 then err.clear
End function


精彩图集

赞助商链接