Function

getTextBeforeSelection

Returns the text before the selection.

getTextBeforeSelection

Source set: Common
public fun TextFieldValue.getTextBeforeSelection(maxChars: Int): AnnotatedString

Returns the text before the selection.

Parameters

maxChars maximum number of characters (inclusive) before the minimum value in TextFieldValue.selection.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: