What is the difference between compareTo and equalsIgnoreCase method?

compareToIgnoreCase() compare two strings lexicographically or as per dictionary ordering. But equalsIgnoreCase() checks only if both strings are equal or not . The return value of compareToIgnoreCase() is an integer that represents if one string is equal, greater than or less than the other one.

Sizin İçin Seçtik  What is the difference between equals and compareTo in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *