最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp字符截取函数
时间:2022-07-02 22:45:09 编辑:袖梨 来源:一聚教程网
asp字符截取函数,取字符函数
<%
'定义字符串判别函数
function strlen(str)
dim p_len
p_len=0
strlen=0
if trim(str)<>"" then
p_len=len(trim(str))
for xx=1 to p_len
if asc(mid(str,xx,1))<0 then
strlen=int(strlen) + 2
else
strlen=int(strlen) + 1
end if
next
end if
end function
'定义截取函数
function strvalue(str,lennum)
dim p_num
dim i
if strlen(str)<=lennum then
strvalue=str
else
p_num=0
x=0
do while not p_num > lennum-2
x=x+1
if asc(mid(str,x,1))<0 then
p_num=int(p_num) + 2
else
p_num=int(p_num) + 1
end if
strvalue=left(trim(str),x)&"…" '截取后定义超出部分内容的显示方式
loop
end if
end function
str="的df萨芬ddsf埃担df罚df离开dfd旧爱对方哀伤的会计法"
response.Write(strvalue(str,11))
%>
相关文章
- 《交错战线》好友拜访有什么好的方法可用 06-16
- 《无期迷途》降临烙印深度介绍 06-16
- 最火2025币圈十大加密货币交易所榜单-最好用比特币交易app币安推荐 06-16
- SNORT币怎么交易-2025币安交易所新手全攻略 06-16
- 《大侠立志传》韩红玉结缘有什么 06-16
- Metaplanet最新购入1,112枚比特币后总持仓突破1万枚大关 06-16