源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

asp截取字符串的两种应用 <font color="red">原创</font>

  • 时间:2022-02-05 14:30 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:asp截取字符串的两种应用 <font color="red">原创</font>
1、纯粹的截取字符串
[u]复制代码[/u] 代码如下:
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、截取字符串,不足用空格补上
[u]复制代码[/u] 代码如下:
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
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部