最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 字符处理程序
时间:2022-07-02 23:09:41 编辑:袖梨 来源:一聚教程网
<%
'*************************************************
'函数名:gotTopic
'作 用:截字符串,汉字一个算两个字符,英文算一个字符
'参 数:str ----原字符串
' strlen ----截取长度
'返回值:截取后的字符串
'*************************************************
function gotTopic(str,strlen)
if str="" then
gotTopic=""
exit function
end if
dim l,t,c, i
str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<")
l=len(str)
t=0
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
gotTopic=left(str,i) & "…"
exit for
else
gotTopic=str
end if
next
gotTopic=replace(replace(replace(replace(gotTopic," "," "),chr(34),"""),">",">"),"<","<")
end function
相关文章
- 二重螺旋魔灵升级材料要哪些 魔灵升级材料一览 10-28
- 溯回青空铉霸怎么样 铉霸角色介绍一览 10-28
- 伊莫簇脊背龙怎么捕捉 簇脊背龙捕捉攻略 10-28
- 伊莫天气怎么改变 改变天气方法 10-28
- 伊莫顽皮鱼怎么样 顽皮鱼玩法介绍 10-28
- 漫威秘法狂潮月亮女孩技能是什么 月亮女孩技能详解 10-28