java equalsignorecase

Solutions on MaxInterview for java equalsignorecase by the best coders in the world

showing results for - "java equalsignorecase"
Laura
23 Apr 2016
1public class JavaExample{
2   public static void main(String args[]){
3	String str1= new String("Apple");
4	String str2= new String("MANGO");
5	String str3= new String("APPLE");
6	System.out.println("str1 equals to str2:"+str1.equalsIgnoreCase(str2));
7	System.out.println("str1 equals to str3:"+str1.equalsIgnoreCase(str3));
8	System.out.println("str1 equals to Welcome:"+str1.equalsIgnoreCase("Welcome"));
9	System.out.println("str1 equals to Apple:"+str1.equalsIgnoreCase("Apple"));
10	System.out.println("str2 equals to mango:"+str2.equalsIgnoreCase("mango"));
11   }
12}
13
14this function doesn not differentiate caps and non caps letters.