Fiveable
Fiveable

Reverse

Definition

Reversing a string means to change the order of its characters, so that the last character becomes the first, the second-to-last becomes the second, and so on.

Analogy

Imagine you have a word written on a piece of paper. To reverse it, you would flip the paper over and read it from right to left instead of left to right.

Related terms

Substring: A substring is a smaller part of a larger string. It can be obtained by extracting characters from within the original string.

Length: The length of a string refers to the number of characters it contains.

Concatenation: Concatenation is combining two or more strings together to create a new string.

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.