String Length
Strings come with handy methods. The simplest one: .length()
String text = "Hello"; IO.println(text.length()); // 5
Watch out: For strings it's .length() with parentheses — for arrays it's .length without!
Replace ??? to print the length of the word.
void main() {
String word = "Programming";
IO.println(???);
}
Strings have lots of built-in methods: .toUpperCase(), .toLowerCase(), .substring(start, end), .indexOf("text"), .replace("old", "new"), .trim() (removes whitespace at the start and end), .contains("text"), .startsWith("prefix").
Since strings are immutable, all of these methods return a new string — the original string stays unchanged.