reverseString
reverseString refers to reversing the order of characters in a string to produce a new string that contains the input characters in reverse sequence. It is a common operation in text processing, used in palindrome checks, data transformation, and various string manipulation tasks.
Implementation typically falls into two categories. The simplest approach builds a new string by iterating from
Unicode and encoding considerations are important. Reversing can affect grapheme clusters, surrogate pairs, or combining marks,
Examples in common languages: in Python, s[::-1] returns the reversed string; in Java, new StringBuilder(s).reverse().toString() reverses