Introduce StringBuilder.clear() extension

#KT-18910 Fixed
This commit is contained in:
Ilya Gorbunov
2018-06-14 03:47:16 +03:00
parent c667340261
commit bbee18b84d
6 changed files with 58 additions and 0 deletions
@@ -14,6 +14,13 @@ package kotlin.text
@kotlin.internal.InlineOnly
public inline operator fun StringBuilder.set(index: Int, value: Char): Unit = this.setCharAt(index, value)
/**
* Clears the content of this string builder making it empty.
*
* @sample samples.text.Strings.clearStringBuilder
*/
@SinceKotlin("1.3")
public actual fun StringBuilder.clear(): StringBuilder = apply { setLength(0) }
private object SystemProperties {
/** Line separator for current system. */