Skip to content

TextEditorSession.ReplaceRange method

Replaces a document range the way a programmatic edit does: the caret and selection ride along with the surrounding text instead of landing on the edit, and the change stays undoable. Editable-region policy is not consulted, which is the caller’s to enforce.

public void ReplaceRange(int start, int length, string? text)