手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp截取字符串的两种应用 原创
asp截取字符串的两种应用 原创
摘要:1、纯粹的截取字符串复制代码代码如下:functioncutstr(thestr1,strlen)diml,t,cl=len(thestr1...

1、纯粹的截取字符串

复制代码 代码如下:

functioncutstr(thestr1,strlen)

diml,t,c

l=len(thestr1)

ifl<1thenexitfunction

t=0

fordxy1=1tol

c=Abs(asc(Mid(thestr1,dxy1,1)))

ifc>255then

t=t+2

else

t=t+1

endif

ift>=strlenthen

thev=mid(thestr1,1,dxy1)

exitfor

else

thev=thestr1

endif

next

cutstr=thev

endfunction

2、截取字符串,不足用空格补上

复制代码 代码如下:

functioncutstr(thestr,strlen)

diml,t,c

l=len(thestr)

t=0

fordxy=1tol

c=Abs(asc(Mid(thestr,dxy,1)))

ifc>255then

t=t+2

else

t=t+1

endif

ift>=strlenthen

thev=left(thestr,dxy)

exitfor

else

bu=strlen-t

forbui=1tobu

strbu=""

strbuall=strbuall&strbu

next

thev=thestr&strbuall

strbu=""

strbuall=""

endif

next

cutstr=thev

endfunction

【asp截取字符串的两种应用 原创】相关文章:

asp中isNull、isEmpty和空字符串的区别

网站制作ASP语言的特点与功能

编写asp代码截取字符串

随机增加网站点击的一个不错的方法 原创

newasp中main类

asp之字符串操作函数

jb51内容分页函数 原创

本人常用的asp代码 原创

在ASP中连接MySQL数据库,最好的通过ODBC方法

截取实际长度字符串,并用空格替换

精品推荐
分类导航