The return value of compareToIgnoreCase() is an integer that represents if one string is equal , greater than or less than the other one. But equalsIgnoreCase() returns one boolean value representing if both strings are equal or not.
Read moreWhat is the difference between compareTo and compareToIgnoreCase in Java?
Java String compareToIgnoreCase() Method example As we know compareTo() method does the same thing, however there is a difference between these two methods. Unlike compareTo() method, the compareToIgnoreCase() method ignores the case (uppercase or lowercase) while comparing strings .
Read moreHow do you use equalsIgnoreCase?
The equalsIgnoreCase() method of the String class compares two strings irrespective of the case (lower or upper) of the string . This method returns a boolean value, true if the argument is not null and represents an equivalent String ignoring case, else false. Syntax: str2.
Read moreWhat is compareToIgnoreCase?
The compareToIgnoreCase() method compares two strings lexicographically, ignoring lower case and upper case differences . The comparison is based on the Unicode value of each character in the string converted to lower case. The method returns 0 if the string is equal to the other string, ignoring case differences.
Read moreHow do I find a particular substring in a string in Java?
You can use contains(), indexOf() and lastIndexOf() method to check if one String contains another String in Java or not. If a String contains another String then it’s known as a substring. The indexOf() method accepts a String and returns the starting position of the string if it exists, otherwise, it will return -1.
Read moreCan we use regex in substring?
REGEXP_SUBSTR extends the functionality of the SUBSTR function by letting you search a string for a regular expression pattern . It is also similar to REGEXP_INSTR , but instead of returning the position of the substring, it returns the substring itself.
Read moreWhat does \\ mean in Java?
The reason is, that first the Java compiler interprets the two \\ characters as an escaped Java String character . After the Java compiler is done, only one \ is left, as \\ means the character \ . The string thus looks like this: \.5 Mar 2019
Read more