最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時(shí)間:2006年06月20日 00:00:00   作者:  

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<0 then w_cut=w_cut&"...":exit for
    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<=0 then w_cut=w_cut&"...":exit for
      w_cut=w_cut&tt
    end if
  next
End Function

%>

相關(guān)文章

最新評論

兴安盟| 呼和浩特市| 西和县| 郴州市| 黄梅县| 囊谦县| 德清县| 襄城县| 龙口市| 南靖县| 响水县| 色达县| 安龙县| 齐齐哈尔市| 赤水市| 集贤县| 崇义县| 屏东市| 喀喇沁旗| 长泰县| 抚顺市| 名山县| 香格里拉县| 福清市| 宜丰县| 浑源县| 定日县| 桓仁| 昌都县| 辽宁省| 大洼县| 永康市| 正蓝旗| 保山市| 云浮市| 静海县| 枣强县| 肇州县| 霍州市| 平果县| 荔波县|