Advertisements
Advertisements
Question
Describe the purpose of the following function with its syntax:
equalsignoreCase()
Code Writing
Advertisements
Solution
This function compares two strings to see if they are identical, ignoring case. The function returns true if the two strings are identical, regardless of case.
Example:
String s1 ="JAPAN";
String s2 = "japan";
boolean b = s1.equalsIgnoreCase(s2)
System.out.println(b);
Output: true
shaalaa.com
Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 289]
