📄 function.asp
字号:
<%
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
'"************* 截取字符串 **************
Function InterceptString(txt,length)
txt=trim(txt)
x = len(txt)
y = 0
if x >= 1 then
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
if y >= length then
txt = left(trim(txt),ii)+"..." '"字符串限长
exit for
end if
next
InterceptString = txt
else
InterceptString = ""
end if
End Function
'"=InterceptString("盛大大撒旦撒大苏打实打实",10)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -