asp提交表单获取值出现逗号的问题

Zi_Yuan Zi_Yuan 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

如上图,为什么我点提交以后,获取到的值倒数第二个后面有个“,”?如图:

这种情况怎么解决?我不要那个逗号。
我的测试代码如下:(其中"item"是从表单中获取的那三个文本域textarea的值)

function checkStr(str)
checkStr=str
end function

items=trim(checkStr(request.Form("item")))
itemarr=split(items,", ")
dim aitem()
for i=0 to itemNum-1
if i<=ubound(itemarr) then
redim Preserve aitem(i)
aitem(i)=itemarr(i)
response.Write(aitem(i)&"<br>")
end if
if i>ubound(itemarr) then
redim Preserve aitem(i)
aitem(i)=" "
response.Write(aitem(i)&"|")
end if
next
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
Zi_Yuan
ASP 28,401 成员 356,940 内容