Comparison
Determine if two strings match.
Example:
String name = "Phil";
if(name.equalsIgnoreCase("phil"))
{
System.out.println("true");
}
Capitalization
There are methods in Java to change a string to UPPER or lower case.
Example:
String name = "Whitby";
System.out.println(name.toUpperCase());
Other
Here are a couple of additional helpful methods:
Index
To find if a string contains a letter or string use an Index method:
Example:
String word;
word = "Baseball";
System.out.println(word.indexOf( "e" ));
Output: 3
Substrings
Sometimes a string may contain multiple words. If you only want the first words entered, or the last word, you need a way to break that string up into individual words.
Example:
String word;
word = "Baseball";
System.out.println(word.substring(4));
Output:
ball