I agree with the top answer, but equalsIgnoreCase also has a null-check to make sure your code doesn't throw an exception if the comparing string is null. Also - the tools are out there, why not use them instead of making your own?