Android 12 Developer Preview is here! Try it out, and give us your feedback!

DeleteSurroundingTextCommand

class DeleteSurroundingTextCommand : EditCommand
kotlin.Any
   ↳ androidx.compose.ui.text.input.DeleteSurroundingTextCommand

Delete lengthBeforeCursor characters of text before the current cursor position, and delete lengthAfterCursor characters of text after the current cursor position, excluding the selection.

Before and after refer to the order of the characters in the string, not to their visual representation.

Summary

Public constructors
<init>(lengthBeforeCursor: Int, lengthAfterCursor: Int)

Delete lengthBeforeCursor characters of text before the current cursor position, and delete lengthAfterCursor characters of text after the current cursor position, excluding the selection.

Public methods
Unit

Apply the command on the editing buffer.

Boolean
equals(other: Any?)

Int

String

Properties
Int

The number of characters in UTF-16 after the cursor to be deleted.

Int

The number of characters in UTF-16 before the cursor to be deleted.

Public constructors

<init>

DeleteSurroundingTextCommand(
    lengthBeforeCursor: Int,
    lengthAfterCursor: Int)

Delete lengthBeforeCursor characters of text before the current cursor position, and delete lengthAfterCursor characters of text after the current cursor position, excluding the selection.

Before and after refer to the order of the characters in the string, not to their visual representation.

Public methods

applyTo

fun applyTo(buffer: EditingBuffer): Unit

Apply the command on the editing buffer.

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String

Properties

lengthAfterCursor

val lengthAfterCursor: Int

The number of characters in UTF-16 after the cursor to be deleted.

lengthBeforeCursor

val lengthBeforeCursor: Int

The number of characters in UTF-16 before the cursor to be deleted.