关于分拆字符串的一个问题~~~~~~~
<%
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值中第一个字符串是否存在,请问这是怎么回事???