国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp截取字符串的兩種應用 原創

2020-07-27 13:29:18
字體:
來源:轉載
供稿:網友
1、純粹的截取字符串
復制代碼 代碼如下:

function cutstr(thestr1,strlen)
dim l,t,c
l=len(thestr1)
if l<1 then exit function
t=0
for dxy1=1 to l
c=Abs(asc(Mid(thestr1,dxy1,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
thev=mid(thestr1,1,dxy1)
exit for
else
thev=thestr1
end if
next
cutstr=thev
end function

2、截取字符串,不足用空格補上
復制代碼 代碼如下:

function cutstr(thestr,strlen)
dim l,t,c
l=len(thestr)
t=0
for dxy=1 to l
c=Abs(asc(Mid(thestr,dxy,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
thev=left(thestr,dxy)
exit for
else
bu=strlen-t
for bui=1 to bu
strbu="&nbsp;"
strbuall=strbuall&strbu
next
thev=thestr&strbuall
strbu=""
strbuall=""
end if
next
cutstr=thev
end function

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 固原市| 东海县| 丁青县| 河北区| 呼玛县| 阿鲁科尔沁旗| 普兰县| 万宁市| 嘉荫县| 大同县| 枣庄市| 榕江县| 雷山县| 莱州市| 和田县| 冷水江市| 宁陕县| 寻甸| 阳城县| 惠水县| 图木舒克市| 额济纳旗| 洛隆县| 特克斯县| 潍坊市| 安远县| 元朗区| 岢岚县| 虹口区| 长垣县| 博乐市| 项城市| 英山县| 东平县| 石首市| 大丰市| 青海省| 洮南市| 固始县| 固始县| 乌兰浩特市|