第一种方法:
用len
<%
Dim a,lengths
a="1,2,3,4,5,6"
lengths=len(a)
lengths=lengths-(lengths-1)/2
Response.Write(""&lengths&"<br />")
%>
第二种方法:
先用split
aa = Split(a,",")
再用ubound
lengths=ubound(aa)+1
<%
Dim a,aa,lengths
a="1,2,3,4,5,6"
aa = Split(a,",")
lengths=ubound(aa)+1
Response.Write(""&lengths&"<br />")
%>
第二种方法:
用InstrRev
<%
Dim a,aa,lengths
a="1,2,3,4,5,6"
lengths=InstrRev (""&a&"",",")
lengths=lengths-(lengths/2)+1
Response.Write(""&lengths&"<br />")
%>
还有很多很多的方法,LZ自己去思考,希望可以看到你自己的更加好的方法
[[italic] 本帖最后由 hangxj 于 2008-1-3 10:32 编辑 [/italic]]