setSelectionRange

fun setSelectionRange(start: Int?, end: Int?, direction: SelectionDirection = definedExternally)(source)

Sets the start and end positions of a selection in a text field.

Parameters

start

The offset into the text field for the start of the selection.

end

The offset into the text field for the end of the selection.

direction

The direction in which the selection is performed.

MDN Reference