# DeleteSurroundingTextCommand

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/input/EditCommand.kt+class:androidx.compose.ui.text.input.DeleteSurroundingTextCommand) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class DeleteSurroundingTextCommand : EditCommand
  ```

*** ** * ** ***

Delete `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#(kotlin.Int,kotlin.Int)` characters of text before the current cursor position, and delete `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#(kotlin.Int,kotlin.Int)` 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.

See [`deleteSurroundingText`](https://developer.android.com/reference/android/view/inputmethod/InputConnection.html#deleteSurroundingText(int,%2520int)).

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#DeleteSurroundingTextCommand(kotlin.Int,kotlin.Int)( lengthBeforeCursor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, lengthAfterCursor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#applyTo(androidx.compose.ui.text.input.EditingBuffer)(buffer: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/EditingBuffer)` Apply the command on the editing buffer. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#lengthAfterCursor()` The number of characters in UTF-16 after the cursor to be deleted. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/DeleteSurroundingTextCommand#lengthBeforeCursor()` The number of characters in UTF-16 before the cursor to be deleted. | Cmn |

## Public constructors

### DeleteSurroundingTextCommand

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
DeleteSurroundingTextCommand(
    lengthBeforeCursor: Int,
    lengthAfterCursor: Int
)
```

| Parameters |
|---|---|
| `lengthBeforeCursor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of characters in UTF-16 before the cursor to be deleted. Must be non-negative. |
| `lengthAfterCursor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of characters in UTF-16 after the cursor to be deleted. Must be non-negative. |

## Public functions

### applyTo

Cmn

```
open fun applyTo(buffer: EditingBuffer): Unit
```

Apply the command on the editing buffer.

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### lengthAfterCursor

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val lengthAfterCursor: Int
```

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

### lengthBeforeCursor

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val lengthBeforeCursor: Int
```

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