Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: string RegexReplace(this string, string, string, RegexOptions)

Declaration

public static string RegexReplace(
    this string input,
    string pattern,
    string replacement,
    RegexOptions options = None
)

Summary

In a specified input string, replaces all strings that match a specified regular expression pattern with a specified replacement string.

Parameters

this stringinput The string to search for a match.
stringpattern The regular expression pattern to match.
stringreplacement The replacement string.
RegexOptionsoptions A bitwise combination of the enumeration values that provide options for matching.

Returns

A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged.