最新下载
热门教程
- 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
相关文章
- 零度曙光盾锤技能怎么搭配 盾锤技能搭配推荐 09-19
- 失控进化建家位置怎么选 建家位置选择推荐 09-19
- 对决剑之川曲玉怎么样 曲玉角色介绍 09-19
- 伊瑟零氪通关月塔源器怎么搭配 零氪通关月塔源器搭配推荐 09-19
- 伊瑟月塔30层莎朗怎么打 月塔30层莎朗打法攻略 09-19
- 鸣潮英雄的凯歌成就怎么完成-2.6英雄的凯歌成就达成方法 09-19