← Back to Week 2 Hub

String Methods Explorer

Click any method to see what it does, then try it on your own string

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.
String Immutability & StringBuilder →