Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: T[] replace(T[], int, Func<int, TMatch, IEnumerable<T>>, int?, bool)

  • Declared in: RT.Generexes.GenerexBase<T, TMatch, TGenerex, TGenerexMatch>

Declaration

protected T[] replace(
    T[] input,
    int startAt,
    Func<int, TMatch, IEnumerable<T>> replaceWith,
    int? maxReplace,
    bool backward
)

Summary

Performs replacements of the non-overlapping matches of the current regular expression within the specified input array.

Parameters

T[]input The input array to match against.
intstartAt Index at which to start the search. Depending on backward, the matching behaviour is like that of GenerexBase<T, TMatch, TGenerex, TGenerexMatch>.Matches(T[], int) or GenerexBase<T, TMatch, TGenerex, TGenerexMatch>.MatchesReverse(T[], int?).
Func<int, TMatch, IEnumerable<T>>replaceWith Delegate that determines what to replace each match with.
int?maxReplace Maximum number of replacements to make, or null for unlimited.
boolbackwardtrue to perform a reverse match (starting from the end of the array and going backwards); false to match forward.

Returns

The new array with the replacements performed.