Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What does the length() method do?
Think about counting characters.
What will name.charAt(0) return if name = "Sarah"?
This is the first character in the string.
What does the trim() method do?
Think about spaces around a string.
The method name.equals("John") checks if the string name is equal to 'John'. True or False?
Consider character matching.
Given the string str = "The quick brown fox jumps over the lazy dog", extract the substring "brown fox" using the substring() method.
Count characters to find the correct indices.
Create a sequence of concatenated strings resulting in a full sentence: 'I love programming.' using at least three string variables.
Think about how parts combine to make a whole.
6 more questions in this section. Enroll free to practise them all.
Enroll free