---
title: "clearText"
description: "Deletes all the text in the state.

To perform more complicated edits on the text, call [TextFieldState.edit]. This function is
equivalent to calling:
```
edit { delete(0, length) placeCursorAtEnd()
}
```"
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun TextFieldState.clearText()
```


Deletes all the text in the state.

To perform more complicated edits on the text, call `TextFieldState.edit`. This function is
equivalent to calling:
```
edit { delete(0, length) placeCursorAtEnd()
}
```



