Method ReplaceText
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
rootDomNodeThe document or subtree to edit.
textstringThe text to find. An empty string matches nothing.
replacementstringThe replacement text. An empty string deletes the match.
optionsFindOptionsThe search options, or null for the defaults.
replaceOptionsReplaceOptionsThe replacement options, or null for the defaults.
Returns
- int
The number of replacements made.
Exceptions
- ArgumentNullException
An argument is null.