deleteCodePointAt

Removes the CodePoint at the specified index from this StringBuilder and returns this instance.

Since Kotlin

2.5

Parameters

index

The position of the code point to remove.

See also

Throws

if index is less than zero or greater than or equal to the length of this string builder.

Samples

import kotlin.text.unicode.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   val builder = StringBuilder("πŸ˜πŸ˜† Kotlin")
val position = builder.offsetByCodePoints(builder.indexOf(' '), codePointOffset = -1)
builder.deleteCodePointAt(position)
println(builder.toString()) // 😁 Kotlin 
   //sampleEnd
}