Skip to content

Doc.replaceSelection method

Doc › replaceSelection

Unofficial

Replaces the current selection with the given string.

Signature:

replaceSelection(replacement: string, select?: "around" | "start" | undefined): void

Parameters:

Parameter Type Description
replacement string The replacement text.
select? "around" | "start" | undefined Optional selection behavior after replacement.

Returns: void