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:

ParameterTypeDescription
replacementstringThe replacement text.
select?"around" | "start" | undefinedOptional selection behavior after replacement.

Returns: void