<%arra = "15,19,210,22,45,6,55" ARRB = "368,111,20,501,22,66,90,55,10" ARRA = Split (Arra, ",") ARRB = Split (ARRB, ",") Se T dic = CreateObject ("Scripting.Dictionary") for i = 0 to UBound (ARRA) If dic. Exists (ARRA (i)) then DiC. Remove Arra (i) Else dic. Add Arra (i), Arra (i) End ifnextfor i = 0 to UBound (ARRB) If dic. Exists (ARRB (i)) then DiC. Remove ARRB (i) Else dic. Add ARRB (i), ARRB (i) End Ifnextarr = dic. Itemsset dic = Nothingresponse.write Join (arr, ",")%>
The following method is simpler
<%dim A,b,ar,d,ia = "15,19,210,22,45,6,55" b = "368,111,20,501,22,66,90,55,10" AR = Split (A & "," & B, ",") Set D = CreateObject ("Scripting.Dictionary") for i = 0 to UBound (AR) If d.exists (AR (i)) then d.remove ar (i) else< C3/>d.add ar (i), AR (i) End Ifnextar = d.itemsset d = nothingresponse.write join (AR, ",")%>
How ASP two arrays are compared, reject the same, keep different