StringReplaceNExtensions extension

Replace first N or last occurrence.

on

Methods

replaceFirstN(String pattern, String replacement, [int? n]) String

Available on String, provided by the StringReplaceNExtensions extension

Replaces the first n occurrences of pattern with replacement.
replaceLast(String pattern, String replacement) String

Available on String, provided by the StringReplaceNExtensions extension

Replaces only the last occurrence of pattern with replacement.