Campbell Ritchie wrote:Try looking in the API for String where you will probably find something useful very quickly.
I assume you are referring to String.equalsIgnoreCase(). That was my first thought as well until I re-read the OP. a and a1 are Arraylists containing Strings, not Strings. Sorry if I'm wrong about your assumption, but I couldn't see anything in the String API that would help here.
My second thought was to check the Collections class to see if it had an equals or compare method that took a Comparator as a parameter, but I couldn't see anything. Maybe satya could write such a method.
I meant both equalsIgnoreCase and the built-in Comparator in the String class, Joanne; you need that Comparator, otherwise it will sort "ONE" "THREE" "two". As you say, you would have to write your own method using it equalsIgnoreCase.
And yes, just like you, I thought it meant comparing the Strings. Sorry.