Method Replace
Replace(string, string)
Searches for the first occurrence of given text within the text content and if succeed replaces it by specified string.
public virtual bool Replace(string text, string replaceWith)
Parameters
Returns
- bool
True if succeed; otherwise false.
Replace(string, string, SearchOptions)
Searches for first occurrence given text within the text content with specified options and if succeed replaces it by specified string.
public virtual bool Replace(string text, string replaceWith, SearchOptions options)
Parameters
textstringText to find.
replaceWithstringText to replace.
optionsSearchOptionsRepresents options to search text.
Returns
- bool
True if succeed; otherwise false.
Replace(string, string, SearchOptions, Regex)
Searches for first occurrence given text within the text content with specified options using specified regular expression and if succeed replaces it by specified string.
public virtual bool Replace(string text, string replaceWith, SearchOptions options, Regex expression)
Parameters
textstringText to find.
replaceWithstringText to replace.
optionsSearchOptionsRepresents options to search text.
expressionRegexRepresents a regular expression to find text.
Returns
- bool
True if succeed; otherwise false.