What this deck covers
This deck focuses on String Manipulation, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study String Manipulation in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
Which method checks if a string ends with a specific suffix?
Tap card or press Space to flip
endsWith(). Tests if the string concludes with specified text.
How well did you know it?
Card 1 / 62
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on String Manipulation, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: endsWith(). Tests if the string concludes with specified text.
Answer: compareTo(). Returns negative, zero, or positive for alphabetical ordering.
Answer: contains(). Tests if string includes specified character sequence.
Answer: endsWith(). Tests if the string concludes with specified text.
Answer:
Answer: Correct: 's = s.toLowerCase();'. Method name is 'toLowerCase', not 'toLowercase'.
Answer: toString(). Converts any object to its string representation.
Answer: "hello". Removes whitespace from both ends of string.
Answer:
Answer: toLowerCase(). Converts all characters to their lowercase equivalents.
Answer:
Answer: "ell". Extracts characters from index 1 to 3 (exclusive).
Answer: "ell". Extracts characters from index 1 to 3 (exclusive).
Answer: contains(). Tests if string includes specified character sequence.
Answer: startsWith(). Tests if the string begins with specified text.
Answer: Correct: 'System.out.println(s.charAt(3));'. String 'Java' has length 4, so valid indices are 0-3.
Answer: replace(). Replaces characters without regex pattern matching.
Answer: replace(). Replaces characters without regex pattern matching.
Answer: 'J'. Returns the character at index 0 (first position).
Answer: length(). Returns the number of characters in the string.
Answer: lastIndexOf(). Returns position of final occurrence of specified character.
Answer: trim(). Removes leading and trailing whitespace characters.
Answer: "cdef". Substring from index 2 to end of string.
Answer: "hello". Removes whitespace from both ends of string.
Answer: concat(). Appends one string to the end of another.
Answer: equals(). Compares string content for exact equality.
Answer: length(). Returns the number of characters in the string.
Answer: true. Case-insensitive comparison returns true for same content.
Answer: toUpperCase(). Converts all characters to their uppercase equivalents.
Answer: equals(). Compares string content for exact equality.
Answer: toLowerCase(). Converts all characters to their lowercase equivalents.
Answer: Correct: 's = s.concat("d");'. Character literals use single quotes, not double quotes.
Answer: indexOf(). Returns position of first occurrence of specified character.
Answer: Correct: 's = s.concat("d");'. Character literals use single quotes, not double quotes.
Answer: toCharArray(). Converts string into array of individual characters.
Answer: concat(). Appends one string to the end of another.
Answer: replace(). Substitutes all occurrences of a character or substring.
Answer: toUpperCase(). Converts all characters to their uppercase equivalents.
Answer: Correct: 'System.out.println(s.charAt(3));'. String 'Java' has length 4, so valid indices are 0-3.
Answer: Correct: 'String s = "hello".toLowerCase();'. String literals don't need 'new String()' constructor.
Answer: compareTo(). Returns negative, zero, or positive for alphabetical ordering.
Answer: "a". Extracts single character from index 1 to 2 (exclusive).
Answer: "cdef". Substring from index 2 to end of string.
Answer:
Answer: indexOf(). Returns position of first occurrence of specified character.
Answer: Correct: 's = s.toLowerCase();'. Method name is 'toLowerCase', not 'toLowercase'.
Answer: replace(). Substitutes all occurrences of a character or substring.
Answer: 'J'. Returns the character at index 0 (first position).
Answer: "abcxyz". Concatenation combines strings into single result.
Answer: substring(). Extracts a portion of the string by index range.
Answer: "abcxyz". Concatenation combines strings into single result.
Answer: toCharArray(). Converts string into array of individual characters.
Answer: true. Case-insensitive comparison returns true for same content.
Answer: Correct: 'String s = "hello".toLowerCase();'. String literals don't need 'new String()' constructor.
Answer: substring(). Extracts a portion of the string by index range.
Answer: isEmpty(). Returns true if string length is zero.
Answer: lastIndexOf(). Returns position of final occurrence of specified character.
Answer: trim(). Removes leading and trailing whitespace characters.
Answer: isEmpty(). Returns true if string length is zero.
Answer: toString(). Converts any object to its string representation.
Answer: startsWith(). Tests if the string begins with specified text.
Answer: "a". Extracts single character from index 1 to 2 (exclusive).