setLength
Sets the length of this string builder to the specified newLength.
If the newLength is less than the current length, it is changed to the specified newLength. Otherwise, null characters '\u0000' are appended to this string builder until its length is less than the newLength.
Note that in Kotlin/JS set operator function has non-constant execution time complexity. Therefore, increasing length of this string builder and then updating each character by index may slow down your program.
Since Kotlin
1.4Throws
or IllegalArgumentException if newLength is less than zero.
Sets the length of this string builder to the specified newLength.
If the newLength is less than the current length, it is changed to the specified newLength. Otherwise, null characters '\u0000' are appended to this string builder until its length is less than the newLength.
Note that in Kotlin/JS set operator function has non-constant execution time complexity. Therefore, increasing length of this string builder and then updating each character by index may slow down your program.
Since Kotlin
1.4Throws
or IllegalArgumentException if newLength is less than zero.
Sets the length of this string builder to the specified newLength.
If the newLength is less than the current length, it is changed to the specified newLength. Otherwise, null characters '\u0000' are appended to this string builder until its length is less than the newLength.
Note that in Kotlin/JS set operator function has non-constant execution time complexity. Therefore, increasing length of this string builder and then updating each character by index may slow down your program.
Since Kotlin
1.3Throws
or IllegalArgumentException if newLength is less than zero.
Sets the length of this string builder to the specified newLength.
If the newLength is less than the current length, it is changed to the specified newLength. Otherwise, null characters '\u0000' are appended to this string builder until its length is less than the newLength.
Note that in Kotlin/JS set operator function has non-constant execution time complexity. Therefore, increasing length of this string builder and then updating each character by index may slow down your program.
Since Kotlin
1.8Throws
or IllegalArgumentException if newLength is less than zero.
Sets the length of this string builder to the specified newLength.
If the newLength is less than the current length, it is changed to the specified newLength. Otherwise, null characters '\u0000' are appended to this string builder until its length is less than the newLength.
Note that in Kotlin/JS set operator function has non-constant execution time complexity. Therefore, increasing length of this string builder and then updating each character by index may slow down your program.
Since Kotlin
1.8Throws
or IllegalArgumentException if newLength is less than zero.