日期:2014-05-16 浏览次数:20868 次
<script type='text/javascript'>
var a=[12,22], b=[1,8,12];
var include= function (str,search,split) {
split =split
------解决方案--------------------
"";
return (split+str+split).indexOf(split+search+split)>-1;
}
var testAb = function (arr1,arr2) {
var str= arr1.join(",");
for(var i=0;i<arr2.length;i++){
if(include(str , arr2[i],",")){
return true;
}
};
return false;
}
alert(testAb (a,b));
</script>
<%
Dim a, b
a = "12,22"
b = "1,8,12"
Public Function CheckInclude(ByVal strA, ByVal strB)
Dim arrA, arrB
arrA = Split(strA, ",")
arrB = Split(strB, ",")
For Each itemB In arrB
For Each itemA In arrA
If itemB = itemA Then
CheckInclude = True
Exit Function
End If
Next
Next
CheckInclude = False
End Function
Response.Write CheckInclude(a, b)
%>