关于分拆字符串的一个问题~~~~~~~

KennyLong KennyLong 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<%
function CheckSameStr(strA, ls, strB)
dim ContStr, StrNum
ContStr = Split(strA, ls)
CheckSameStr = False
for StrNum = 0 to UBound(ContStr)
If strB = ContStr(StrNum) then
CheckSameStr = true
end if
next
end function


str="0,1,2"
if CheckSameStr(sitelog_opt, ",", "2")=true then
  response.write "存在2值"
end if
%>

以上是一个根据指定符号来分解字符串然后查询是否有指定的字符串存在,代码调试一切正常,但str的值是从一组复选表单中取来的,取来的值是str="0, 1, 2",中间有空格,这时候我那个分解函数好像就失效了,只能查询str值中第一个字符串是否存在,请问这是怎么回事???
...全文
评论 3
收藏 已收藏
分享
返回顶部
KennyLong
ASP 28,401 成员 356,940 内容