求助asp高手输出问题

来源:百度知道 编辑:UC知道 时间:2024/05/10 05:37:42
我有一表单提交过来的内容是:1,2,4,4,5;1,2,3,4,5;1,2,4,4,5;1,2,3,4,5;1,2,4,4,5;1,2,3,4,5;1,2,4,4,5;1,2,3,4,5;
我想在显示网页上显示成这样
1,2,4,4,5 1,2,3,4,5 1,2,4,4,5
1,2,3,4,5 1,2,4,4,5 1,2,4,4,5
就是把上面的以分号为分隔,一行显示三组,然后换行显示,如何转换格式
我按照chinazoya 的方法把这组数据转换了000,015,017,030,034,037,040,043,044,046,049,052,053,056,059,063,066,067,096,097,098,100,130,180,201,270,290,301,305,306,380,400,403,470,490,500,504,520,609,630,701,702,708,800,803,804,890,907,960,990
结果转换后没有换行,转换后我查看原文件是这样
000 015 017 030 034 037 040 043 044 046 049 052 053 056 059 063 066 067 096 097 098 100 130 180 201 270 290 301 305 306 380 400 403 470 490 500 504 520 609 630 701 702 708 800 803 804 890 907 960 990 没有写入换行符

我把你的语句改成这样
<%
str1=request(&q

这样就可以了。因为二楼那位的i+1 mod 3=0少了括号
<%
str1="1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
str2=split(str1,",")
for i=0 to ubound(str2)
response.write str2(i)&" "
if ((i+1) mod 3)=0 then response.write "<br>"
next
%>

假如表单提交过来的内容1,2,4,4,5;1,2,3,4,5;1,2,4,4,5;1,2,3,4,5;1,2,4,4,5;1,2,3,4,5;1,2,4,4,5;1,2,3,4,5; 都是放在字符串变量STR1中
str2=split(str1,";")
for i=0 to ubound(str2)
response.write str2(i)&" "
if (i+1 mod 3)=0 then response.write "<br>"
next

是xmlhttprequest返回的数据吗?
同样的处理啊...

<%
str1=request("YouHuaHaoMa")
str2=split(str1,";")
u=0
for i=0 to ubound(str2)
u=u+1
b=b & str2(i) & " "
if u>=3 then
b=b & "<br>"
u=0
end if

next

response.write(b)
%