Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.32 KB

File metadata and controls

34 lines (25 loc) · 1.32 KB

String

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.

String Operations

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

🔗 Further Reading