聊城网站制作公司,聊城网站建设,聊城网站优化,聊城网络公司,聊城网站推广,聊城网站运营,聊城网络运营,聊城搜索引擎优化,聊城网页设计,聊城网站制作
 
 
公司拥有五年的网站建设经验,专业网站制作,推广及网站优化,有大量优秀客户案例
网站建设 | 设为首页 | 加入收藏 | 联系我们  
公告:热烈庆祝聊城精英网络2010版官方网站改版成功!
当前位置 :首页 > 网页知识  

asp截取字符串的两种应用[原创]

http://www.wangzhan123.net   2010-12-23   人气:

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

专业设计团队
满足您的各种设计要求
实力程序开发团队
为您定制各种程序模块
后台管理高效安全
方便更新上传网站资料
全球高速访问
无盲区、定制异地备份
专业客服团队
解决一切使用难题
赠送大容量空间邮箱
免费优化推广
   
关于我们 | 工作机会 | 付款方式 | 网站制作 | 网页制作 | 网页设计 | 网络公司 | 联系我们 | 网站地图
版权所有:聊城精英网络科技有限公司 © 2005-2010 All Rights Reserved.
咨询专线:0635-6950368 技术专线:15192175820 在线QQ:312817927 1485871644
地址:聊城市闸口科技市场 邮编:252000 苏ICP备10112026号