---
title: "getTextAfterSelection"
description: "Returns the text after the selection."
type: "function"
---

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


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


```kotlin
fun TextFieldValue.getTextAfterSelection(maxChars: Int): AnnotatedString
```


Returns the text after the selection.

#### Parameters

| | |
| --- | --- |
| maxChars | maximum number of characters (exclusive) after the maximum value in `TextFieldValue.selection`. |




