Table of Contents

Method ReplaceText

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

ReplaceText(DomNode, string, string, FindOptions?, ReplaceOptions?)

Replaces every occurrence of a literal string.

public static int ReplaceText(this DomNode root, string text, string replacement, FindOptions? options = null, ReplaceOptions? replaceOptions = null)

Parameters

root DomNode

The document or subtree to edit.

text string

The text to find. An empty string matches nothing.

replacement string

The replacement text. An empty string deletes the match.

options FindOptions

The search options, or null for the defaults.

replaceOptions ReplaceOptions

The replacement options, or null for the defaults.

Returns

int

The number of replacements made.

Exceptions

ArgumentNullException

An argument is null.