ASP中取字符串中第N个字符_网站设计制作
作者:admin 日期:2012-09-27
来源: Duing-冬忆个人博客
asp中可以用vb语言
vb的函数有
mid(str,1,2)函数,str表示你要取的字符串,1代表从str中第1个字符开始,2代表要取几个字符。这个函数你可以用在asp中,也可以用在vbscript中
asp语言中可以这么做:
例如str="hello world" (你要从中取第1个字符到第2个字符)
dim str,str2
str="hello world"
num=len(str) '读取字符串共几个字符
for ii=1 to num
str2=str2&","&mid(str,ii,1)
next
response.write str2
str2就是要读取的字符!!
原文链接地址:http://www.duing.cn/article/study/ASPQuZiFuChuan.html
asp中可以用vb语言
vb的函数有
mid(str,1,2)函数,str表示你要取的字符串,1代表从str中第1个字符开始,2代表要取几个字符。这个函数你可以用在asp中,也可以用在vbscript中
asp语言中可以这么做:
例如str="hello world" (你要从中取第1个字符到第2个字符)
dim str,str2
str="hello world"
num=len(str) '读取字符串共几个字符
for ii=1 to num
str2=str2&","&mid(str,ii,1)
next
response.write str2
str2就是要读取的字符!!
原文链接地址:http://www.duing.cn/article/study/ASPQuZiFuChuan.html






评论: 0 | 引用: 0 | 查看次数: -
发表评论