See implementation in C++, Java, Python, Typescript
In competitive programming, programmers use strings or arrays to store and manipulate sequences of characters. This data structure is straightforward, fast, and easy to use.
Here are some basic operations that you can perform on strings:
- Initialization: Create a string with given value
- Accessing Characters: Access a character by its index (zero-based)
- Updating Characters: Update a character by its index
- Traversal: Visit all characters of the string
- Length: Get the number of characters in the string
- Substring: Extract a portion of the string
- Comparison: Compare two strings for equality
- Reversal: Reverse the order of characters in the string
More operations
- Uppercase: Convert all characters in the string to uppercase
- Lowercase: Convert all characters in the string to lowercase
- Letters & Numbers: Check if characters in the string are letters or numbers
- String (computer science), wikipedia
▶️ Strings, CS50▶️ CS50 Explained 2016 - Week 2 - Strings, CS50