PrepGo

AP Computer Science Principles Flashcards: Strings

Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026

Review key ideas with interactive flashcards. This set includes 10 cards to help you master important concepts.

What is the relationship between a string and its substring?
A substring is always a smaller or equal-length portion contained within a larger original string.
Card 1 of 10

All Flashcards (10)

What is the relationship between a string and its substring?
A substring is always a smaller or equal-length portion contained within a larger original string.
Define the term 'substring'.
A substring is a contiguous sequence of characters that is part of an existing, larger string.
What is the primary purpose of evaluating expressions that manipulate strings?
The purpose is to determine the final string value that results from performing one or more operations, such as concatenation or extracting a substring.
Is the word "string" a substring of the phrase "existing string"?
Yes, "string" is a substring because it is a part of the larger, existing string.
If you concatenate the string "AP" with the string "Exam", what is the resulting new string?
The resulting new string is "APExam", as concatenation joins the two strings end-to-end.
Does the process of concatenation alter the original strings?
No, string concatenation does not change the original strings; it always creates a new string as the result.
Is "cat" a substring of "concatenation"?
Yes, "cat" is a substring of "concatenation" as it is a part of that existing string.
Evaluate the result of concatenating three strings: "end", "-to-", and "end".
The evaluated expression results in the new string "end-to-end".
What is string concatenation?
String concatenation is the process of joining two or more strings together end-to-end to make a new, single string.
What is the general term for actions like concatenation or finding a substring?
These actions are known as operations that manipulate strings.