W3cubDocs

/Kotlin

reverse

Platform and version requirements: JS (1.1), Native (1.3)
fun reverse(): StringBuilder

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.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-string-builder/reverse.html