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


<a id='references'></a>


<h2 id="coercein-minimumvalue-maximumvalue">coerceIn</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun TextRange.coerceIn(minimumValue: Int, maximumValue: Int): TextRange
```


Ensures that `TextRange.start` and `TextRange.end` values lies in the specified range
`minimumValue` and `maximumValue`. For each `TextRange.start` and `TextRange.end` values:
- if value is smaller than `minimumValue`, value is replaced by `minimumValue`
- if value is greater than `maximumValue`, value is replaced by `maximumValue`

#### Parameters

| | |
| --- | --- |
| minimumValue | the minimum value that `TextRange.start` or `TextRange.end` can be. |
| maximumValue | the exclusive maximum value that `TextRange.start` or `TextRange.end` can be. |