Examveda
Examveda

Which of the following is the correct way to compare two strings in a case-insensitive manner in Java?

A. str1.equals(str2)

B. str1.compareToIgnoreCase(str2)

C. str1.equalsIgnoreCase(str2)

D. str1.compare(str2)

Answer: Option C


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings