reverse

Common
JS
1.0

Reverses the contents of this string builder and returns this instance.

Surrogate pairs included in this string builder are treated as single characters. Therefore, the order of the high-low surrogates is never reversed.

Note that the reverse operation may produce new surrogate pairs that were unpaired low-surrogates and high-surrogates before the operation. For example, reversing "\uDC00\uD800" produces "\uD800\uDC00" which is a valid surrogate pair.