Java String equalsIgnoreCase() Method

 Posted On  | Yashwant Chavan 

In this tutorial you will learn how to perform case in-sensitive comparison of strings in Java. String equalsIgnoreCase() method compares two strings with ignoring case considerations.

Refer below steps

  • String.equalsIgnoreCase() method compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring case if they are of the same length and corresponding characters in the two strings are equal.

Java String.equalsIgnoreCase() method example

package com.technicalkeeda.app;

public class StringEqualsIgnoreCase {

    public static void main(String args[]) {

        String method = "get";
        System.out.println(method.equalsIgnoreCase("GET"));
        System.out.println(method.equalsIgnoreCase("Get"));

    }
}

Output

true
true


© technicalkeeda.com 2017

 |  Find us on Google+ |  Rss Feed

Loaded in 0.0345 seconds.