展会信息港展会大全

asp 中英文字符长度检测判断函数
来源:互联网   发布日期:2016-03-01 11:05:19   浏览:1911次  

导读: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 c0 then c=c+65536 if c255 then t=t+1 End if next strLengt...

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

赞助本站

人工智能实验室

相关热词: 开发 编程 android

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港