Skip to content

Editor.replaceRange method

Editor › replaceRange

Official

Replace the range between two positions.

Signature:

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

Parameters:

ParameterTypeDescription
replacementstringThe replacement text.
fromEditorPositionThe start position.
to?EditorPositionThe end position.
origin?stringThe user event that triggered the replacement.

Returns: void

Since: 0.11.11

Example:

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