in reply to Re^2: check 2 string arrays
in thread check 2 string arrays

Note the 'last;' in toolics version of the search loop. That makes sure that the loop stops as soon as the first solution is found.

After that the only thing left to do is to order array2 so that the first found solution is always the one you want