当前位置:编程学习 > asp >>

asp统计中文混合的字符串长度

答案: ***************************************
'统计中文混合的字符串长度
'***************************************
function strCount(strString)
Dim I,count
  if Trim(strString)="" Or IsNull(strString) then
     count=0
  else
     count=0
     for I=1 to Len(Trim(strString))
        if Asc(Mid(strString,I,1))<0 then
           count=count+2
        else
           count=count+1
        end if
    next
  end if
  strCount=count
end function

上一个:asp返回正则匹配结果
下一个:asp转换字符串编码

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,