最新下载
热门教程
- 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
相关文章
- 完美世界异环最新消息 2024年上线时间及测试动态 05-14
- 异环鬼火坐骑怎么获取 异环鬼火摩托获取方法与技巧详解 05-14
- 异环粉爪积分获取方法大全 异环粉爪积分快速提升技巧与途径 05-14
- 异环海月 异环海月角色背景、技能解析与实战玩法指南 05-14
- 异环伊洛伊怎么样 异环伊洛伊强度解析与实战表现评价 05-14
- 王者荣耀世界角色强度排行 王者荣耀世界当前版本强势英雄推荐 05-14