WEB DEVELOPER SITE
PHP7
 

Java String equalsIgnoreCase() Method



Compares this String to another String, ignoring case considerations.


Syntax

Here is the syntax of this method โˆ’

public boolean equalsIgnoreCase(String anotherString)

Parameters

Here is the detail of parameters โˆ’

  • anotherString โˆ’ the String to compare this String against.

Return Value

  • This method returns true if the argument is not null and the Strings are equal, ignoring case; false otherwise.

Example


public class Test {

   public static void main(String args[]) {
      String s = "Strings are immutable";
      char result = s.charAt(9);
      System.out.println(result);
   }
}

Run example ยป