I want to know if a word is the same as a other, but large and lower case shouldn't matter. some how like this:
String a = new String "test";
String b = new String "Test";
a.equals(b); // should be true;
I want to know if a word is the same as a other, but large and lower case shouldn't matter. some how like this:
String a = new String "test";
String b = new String "Test";
a.equals(b); // should be true;
You can use String::equalsIgnoreCase
boolean check = a.equalsIgnoreCase(b);
Note : the declaration of your Strings is not correct it should be :
String a = "test";// or String a = new String("test");
String b = "Test";// or String b = new String("Test");
An alternative is to change both to lowerCase or upperCase and then compare:
String a = "test";
String b = "Test";
System.out.println(a.toLowerCase().equals(b.toLowerCase())); // prints true