How to check if two strings are equals using equalsIgnoreCase() in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            String s1 = "java";
            String s2 = "JAva";

            boolean b = s1.equalsIgnoreCase(s2);
            System.out.println(b);

        } catch (Exception e) {
            System.out.print(e.toString());
        }
    }
}

/*
           
run:
     
true
  
 */

 



answered Nov 22, 2016 by avibootz
...