String str = " Hello, World! ";
Length: 17 characters
Choose a Method
.length()
Count characters
.trim()
Remove spaces
.toUpperCase()
All caps
.toLowerCase()
All lowercase
.charAt(i)
Char at index
.indexOf(str)
Find position
.substring(s,e)
Extract piece
.startsWith(s)
Starts with?
.endsWith(s)
Ends with?
.equals(s)
Exact match?
.equalsIgnoreCase()
Match (no case)
.split(delim)
Break apart
Result
Click a method card on the left to see it in action
Try Your Own String
Type any string and click "Use This String" to explore methods on your own text. Click "Reset" to go back to the default.