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.