Replace()

Regex::Replace(const String&, const String&) method

Replaces all matches of regex in string with replacement string.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &replacement)

Arguments

ParameterTypeDescription
inputconst String&Input string.
replacementconst String&Replacement string.

Return Value

Input string with all regex matches replaced with replacement string.

Regex::Replace(const String&, const char_t *) method

Replaces all matches of regex in string with replacement string.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const char_t *replacement)

Arguments

ParameterTypeDescription
inputconst String&Input string.
replacementconst char_t *Replacement string.

Return Value

Input string with all regex matches replaced with replacement string.

Regex::Replace(const String&, const MatchEvaluator&) method

Replaces all matches in string with delegate-generated replacement strings.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const MatchEvaluator &evaluator)

Arguments

ParameterTypeDescription
inputconst String&Input string.
evaluatorconst MatchEvaluator&Delegate to generate replacement strings based on matches.

Return Value

Input strings with all matches replaced.

Regex::Replace(const String&, const MatchEvaluator&, int) method

Replaces all matches in string with delegate-generated replacement strings.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const MatchEvaluator &evaluator, int count)

Arguments

ParameterTypeDescription
inputconst String&Input string.
evaluatorconst MatchEvaluator&Delegate to generate replacement strings based on matches.
countintNumber of replacements limit.

Return Value

Input strings with all matches replaced.

Regex::Replace(const String&, const MatchEvaluator&, int, int) method

Replaces all matches in string with delegate-generated replacement strings.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const MatchEvaluator &evaluator, int count, int startat)

Arguments

ParameterTypeDescription
inputconst String&Input string.
evaluatorconst MatchEvaluator&Delegate to generate replacement strings based on matches.
countintNumber of replacements limit.
startatintIndex in input string to start replacement at.

Return Value

Input strings with all matches replaced.

Regex::Replace(const String&, const String&, int) method

Replaces substrings in string. Not implemented.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &replacement, int count)

Regex::Replace(const String&, const String&, int, int) method

Replaces substrings in string. Not implemented.

String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &replacement, int count, int startat)

Regex::Replace(const String&, const char_t *, const char_t *) method

Replaces all matches of regex in string with replacement string.

static String System::Text::RegularExpressions::Regex::Replace(const String &input, const char_t *pattern, const char_t *replacement)

Arguments

ParameterTypeDescription
inputconst String&Input string.
patternconst char_t *Regex pattern.
replacementconst char_t *Replacement string.

Return Value

Input string with all regex matches replaced with replacement string.

Regex::Replace(const String&, const String&, const char_t *) method

Replaces all matches of regex in string with replacement string.

static String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &pattern, const char_t *replacement)

Arguments

ParameterTypeDescription
inputconst String&Input string.
patternconst String&Regex pattern.
replacementconst char_t *Replacement string.

Return Value

Input string with all regex matches replaced with replacement string.

Regex::Replace(const String&, const String&, const MatchEvaluator&, RegexOptions) method

Replaces all matches in string with delegate-generated replacement strings (static function).

static String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &pattern, const MatchEvaluator &evaluator, RegexOptions options)

Arguments

ParameterTypeDescription
inputconst String&Input string.
patternconst String&Regex pattern.
evaluatorconst MatchEvaluator&Delegate to generate replacement strings based on matches.
optionsRegexOptionsRegex options.

Return Value

Input strings with all matches replaced.

Regex::Replace(const String&, const String&, const String&, RegexOptions) method

Replaces all matches of regex in string with replacement string.

static String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &pattern, const String &replacement, RegexOptions options)

Arguments

ParameterTypeDescription
inputconst String&Input string.
patternconst String&Regex pattern.
replacementconst String&Replacement string.
optionsRegexOptionsRegex options.

Return Value

Input string with all regex matches replaced with replacement string.

Regex::Replace(const String&, const String&, const String&) method

Replaces regex matches.

static String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &pattern, const String &replacement)

Arguments

ParameterTypeDescription
inputconst String&Input string.
patternconst String&Regexp pattern.
replacementconst String&Replacement string.

Return Value

String with all matches replaced.

Regex::Replace(const String&, const String&, const MatchEvaluator&) method

Replaces regex matches.

static String System::Text::RegularExpressions::Regex::Replace(const String &input, const String &pattern, const MatchEvaluator &evaluator)

Arguments

ParameterTypeDescription
inputconst String&Input string.
patternconst String&Regexp pattern.
evaluatorconst MatchEvaluator&Delegate to generate replacement string for each match.

Return Value

String with all matches replaced.

See Also