'用于获取字符串字节数'''''''''''
function getstr(str,num)
total = num-3
strlen = 0
for i=1 to len(str)
currentchar = mid(str,i,1) '截取每个字符进行判断
strPriTmpXX = server.URLEncode(currentchar)
arrPriTmp = split(strPriTmpXX,"%")
if ubound(arrPriTmp) >=2 then
strlen = strlen+2 '中文字符长度+2
else
strlen = strlen+1
end if
if strlen >= total then
getstr = getstr&"" '超过num加省略号
exit for
else
getstr = getstr¤tchar
end if
next
end function
function getstr(str,num)
total = num-3
strlen = 0
for i=1 to len(str)
currentchar = mid(str,i,1) '截取每个字符进行判断
strPriTmpXX = server.URLEncode(currentchar)
arrPriTmp = split(strPriTmpXX,"%")
if ubound(arrPriTmp) >=2 then
strlen = strlen+2 '中文字符长度+2
else
strlen = strlen+1
end if
if strlen >= total then
getstr = getstr&"" '超过num加省略号
exit for
else
getstr = getstr¤tchar
end if
next
end function