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

首頁 > 編程 > ASP > 正文

截取實際長度字符串,并用空格替換

2024-05-04 11:04:58
字體:
供稿:網(wǎng)友

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="?"
strbuall=strbuall&strbu
next
thev=thestr&strbuall
strbu=""
strbuall=""
end if
next
cutstr=thev
end function

'============================
'函數(shù)名w_cut(type,num)
'作用:字符串截取
'參數(shù)type,num
'type:字符串內(nèi)容
'num:字符串被截取的長度
'=============================

Function w_cut(types,num)
? dim ctypes,cnum,ci,tt,tc,cc
? ctypes=types:cnum=int(num):w_cut="":tc=0:cc=0
? for ci=1 to len(ctypes)
??? if cnum ??? tt=mid(ctypes,ci,1)
??? if int(asc(tt))>=0 then
????? w_cut=w_cut&tt
????? tc=tc+1:cc=cc+1
????? if tc=2 then
??????? tc=0:cnum=cnum-1
????? end if
????? if cc>5 then cnum=cnum-1:cc=0
??? else
????? cnum=cnum-1
????? if cnum ????? w_cut=w_cut&tt
??? end if
? next
End Function

%>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 阳谷县| 神木县| 宝丰县| 蕉岭县| 鸡西市| 容城县| 泰兴市| 镇雄县| 商洛市| 云安县| 益阳市| 元氏县| 淮南市| 兴国县| 西华县| 大余县| 孝义市| 凌海市| 宣化县| 札达县| 城口县| 台湾省| 专栏| 明溪县| 邻水| 茌平县| 宁化县| 海阳市| 庐江县| 宣城市| 满城县| 大城县| 宜兰市| 衡南县| 兰溪市| 库车县| 从江县| 和林格尔县| 商河县| 应城市| 铜梁县|