insert
Inserts the string representation of the specified boolean value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified int value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified long value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified float value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified double value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts characters in the specified character array value into this string builder at the specified index and returns this instance.
The inserted characters go in same order as in the value character array, starting at index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
fun insert(index: Int, value: CharSequence?): StringBuilder
(Common source) (JS source) (Native source)
Inserts characters in the specified character sequence value into this string builder at the specified index and returns this instance.
The inserted characters go in the same order as in the value character sequence, starting at index.
Parameters
index
- the position in this string builder to insert at.
value
- the character sequence from which characters are inserted. If value is null
, then the four characters "null"
are inserted.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified object value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified byte value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.
Inserts the string representation of the specified short value into this string builder at the specified index and returns this instance.
The overall effect is exactly as if the value were converted to a string by the value.toString()
method,
and then that string was inserted into this string builder at the specified index.
Exceptions
IndexOutOfBoundsException
- if index is less than zero or greater than the length of this string builder.