Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: T[] Replace(T[], IEnumerable<T>, int, int?)

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

Declaration

public T[] Replace(
    T[] input,
    IEnumerable<T> replaceWith,
    int startAt = 0,
    int? maxReplace = null
)

Summary

Replaces each match of this regular expression within the given input sequence with a replacement sequence.

Parameters

T[]input Input sequence to match the regular expression against.
IEnumerable<T>replaceWith The sequence to replace each match with.
intstartAt Optional index within the input sequence at which to start matching.
int?maxReplace Optional maximum number of replacements to make (null for infinite).

Returns

The resulting sequence containing the replacements.

Remarks

The replaceWith enumerable is only enumerated if a replacement is actually made. If multiple replacements are made, it is enumerated only once.