Replace Method
Replace(String, String)
Searches for the first occurrence of given text within the text content and if succeed replaces it by specified string.
Declaration
public virtual bool Replace(string text, string replaceWith)
Parameters
Type | Name | Description |
---|---|---|
String | text | Text to find. |
String | replaceWith | Text to replace. |
Returns
Type | Description |
---|---|
Boolean | True if succeed; otherwise false. |
Implements
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.
Declaration
public virtual bool Replace(string text, string replaceWith, SearchOptions options)
Parameters
Type | Name | Description |
---|---|---|
String | text | Text to find. |
String | replaceWith | Text to replace. |
SearchOptions | options | Represents options to search text. |
Returns
Type | Description |
---|---|
Boolean | True if succeed; otherwise false. |
Implements
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.
Declaration
public virtual bool Replace(string text, string replaceWith, SearchOptions options, Regex expression)
Parameters
Type | Name | Description |
---|---|---|
String | text | Text to find. |
String | replaceWith | Text to replace. |
SearchOptions | options | Represents options to search text. |
Regex | expression | Represents a regular expression to find text. |
Returns
Type | Description |
---|---|
Boolean | True if succeed; otherwise false. |