如何测试字符串的长度?
时间:2021-05-05 15:36:22|栏目:|点击: 次
如何测试字符串的长度?
Function CheckStringLength(txt)
txt=trim(txt)
x = len(txt)
y = 0
for ii = 1 to x
if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then
' 如果是中文.
y = y + 2
else
y = y + 1
end if
next
CheckStringLength = y
End Function
栏 目:
下一篇:docker 容器上编译 go 程序提示找不到文件问题
本文标题:如何测试字符串的长度?
本文地址:http://www.codeinn.net/misctech/115130.html






