replace

fun replace(start: Int, end: Int, text: @Nls CharSequence)

Replaces the characters in [start, end) with text.

Parameters

start

the offset of the first character replaced.

end

the offset just past the replaced span; equal to start it deletes nothing and the text is inserted there.

text

the characters written in the span's place; empty text deletes the span.

See also


fun replace(start: Int, end: Int, text: @Nls CharSequence, attributes: AttributeSet)

Replaces the characters in [start, end) with text carrying attributes.

Parameters

start

the offset of the first character replaced.

end

the offset just past the replaced span; equal to start it deletes nothing and the text is inserted there.

text

the characters written in the span's place, as one run; empty text deletes the span.

attributes

the attributes that run carries.

See also