{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

TextFieldValueKt

public final class TextFieldValueKt


Summary

Public methods

static final @NonNull AnnotatedString

Returns the currently selected text.

static final @NonNull AnnotatedString
getTextAfterSelection(@NonNull TextFieldValue receiver, int maxChars)

Returns the text after the selection.

static final @NonNull AnnotatedString
getTextBeforeSelection(@NonNull TextFieldValue receiver, int maxChars)

Returns the text before the selection.

Public methods

getSelectedText

public static final @NonNull AnnotatedString getSelectedText(@NonNull TextFieldValue receiver)

Returns the currently selected text.

getTextAfterSelection

public static final @NonNull AnnotatedString getTextAfterSelection(@NonNull TextFieldValue receiver, int maxChars)

Returns the text after the selection.

Parameters
int maxChars

maximum number of characters (exclusive) after the maximum value in TextFieldValue.selection.

See also
max

getTextBeforeSelection

public static final @NonNull AnnotatedString getTextBeforeSelection(@NonNull TextFieldValue receiver, int maxChars)

Returns the text before the selection.

Parameters
int maxChars

maximum number of characters (inclusive) before the minimum value in TextFieldValue.selection.

See also
min