Java string compareToIgnoreCase and compareTo methods

compareToIgnoreCase and compareTo methods : Java String methods compareToIgnoreCase and compareTo can be used to compare two strings. In this tutorial, we will learn how these methods work with examples.   compareToIgnoreCase : The syntax of compareToIgnoreCase method is as below : public int compareToIgnoreCase(String str) This is a public Read more…

Java compareToIgnoreCase method explanation with an example

Introduction : compareToIgnoreCase¬†is a public method in the String class of Java. We can use this method to compare two Strings lexicographically and ignoring the case.The provided string is normalized by using Character.toLowerCase(Character.toUpperCase(character)) on each character of the String.   Syntax of compareToIgnoreCase : The syntax of this method is Read more…