最新下载
热门教程
- 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
相关文章
- 土豆视频网页版入口-土豆视频官网访问地址 01-05
- 崩坏星穹铁道流萤角色专属成就达成攻略 01-05
- 快手官网网页版入口-快手网页版在线登录直达 01-05
- 羊蹄山之魂新手开荒盔甲推荐 羊蹄山之魂新手盔甲怎么选 01-05
- 囧次元官网入口在哪-最新官网入口分享 01-05
- 羊蹄山之魂全风铃位置一览 羊蹄山之魂风铃位置详情 01-05