clear

Clears the content of this string builder making it empty and returns this instance.

Since Kotlin

1.3

Samples

import java.util.Locale
import kotlin.test.*

fun main() { 
   //sampleStart 
   val builder = StringBuilder()
builder.append("content").append(1)
println(builder) // content1

builder.clear()
println(builder) // 
   //sampleEnd
}