Copy link to clipboard
Copied
I have 2 strings --String A and String B
String A (1,2,3,4,5,6,7,8)
String B (1,2,3,4,9,10,11,12)
I need to compare the 2 strings and find the values that ARE IN BOTH strings.
So the answer I need to get is 1,2,3,4 as 1,2,3,4 is in BOTH strings.
I cant find anything in the CF String Functions.
Any Ideas?
There are different ways to slice it. But a general approach is to loop through one of the lists. Then for each element, use list functions (ie listFindNoCase, etcetera) to determine if it exists in the other list as well. If it does, append the value to a variable. At the end of the loop, you will have a list of elements contained in both lists.
Having said that, cflib.org is always a good place to check first.
http://cflib.org/udf/ListInCommon
Copy link to clipboard
Copied
There are different ways to slice it. But a general approach is to loop through one of the lists. Then for each element, use list functions (ie listFindNoCase, etcetera) to determine if it exists in the other list as well. If it does, append the value to a variable. At the end of the loop, you will have a list of elements contained in both lists.
Having said that, cflib.org is always a good place to check first.
http://cflib.org/udf/ListInCommon