string.equalsIgnoreCase()
String.equalsIgnoreCase() Checks two strings and returns boolean vlaue true if both are equal.
Syntax
String1.equalsIgnoreCase(String2)
Return value is boolean ( true or false )
Here are some examples with output.
String my_str1="plus2net";
System.out.println(my_str1.equalsIgnoreCase("plus2net")); // true
System.out.println(my_str1.equalsIgnoreCase("Plus2net")); // true
System.out.println(my_str1.equalsIgnoreCase("PLUS2NET")); // true
System.out.println(my_str1.equalsIgnoreCase("2net")); // false
This is case insensitive matching of two strings
« All String functions
« Java
This article is written by plus2net.com team.
plus2net.com