Skip to content

Doc.replaceSelection method

Doc › replaceSelection

Unofficial

Replaces the current selection with the given string.

Signature:

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

Parameters:

ParameterTypeDescription
replacementstringThe replacement text.
select?'around' | 'start'Optional selection behavior after replacement.

Returns: void