System.Text.RegularExpressions.Match.Result Method

Returns the expansion of the specified replacement pattern.

Syntax

public virtual string Result (string replacement)

Parameters

replacement
The replacement pattern to use.

Returns

The expanded version of the replacement parameter.

Remarks

Whereas the Regex.Replace(string, string) method replaces all matches in an input string with a specified replacement pattern, the Match.Result(string) method replaces a single match with a specified replacement pattern. Because it operates on an individual match, it is also possible to perform processing on the matched string before you call the Match.Result(string) method.

The replacement parameter is a standard regular expression replacement pattern. It can consist of literal characters and regular expression substitutions. For more information, see Substitutions.

Requirements

Namespace: System.Text.RegularExpressions
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0