Skip to content

Editor.replaceRange method

Editor › replaceRange

Official

Replace the range between two positions.

Signature:

replaceRange(replacement: string, from: EditorPosition, to?: EditorPosition | undefined, origin?: string | undefined): void

Parameters:

Parameter Type Description
replacement string The replacement text.
from EditorPosition The start position.
to? EditorPosition | undefined The end position.
origin? string | undefined The user event that triggered the replacement.

Returns: void

Since: 0.11.11

Example:

editor.replaceRange('foo', from, to);