str1="1235,12,23,34,123,21,56,74,1232"
str2="12"
问题:如何判断str2是否存在str1中,要求准确找出12,不能找出str1中的1235、123、1232
实现代码:
<%
str1="1235,1232"
str2="12"
b = 0
aa=split(str1,",")
for i = 1 to ubound(aa)
IF AA(i) = str2 then
b = b+1
end if
next
if b>0 then
response.write str1&"中有"&b&"个"&str2
elseif b=0 then
response.write str1&"中不包含"&str2
end if
%>