replaceMany method

String replaceMany(
  1. Iterable<Pattern> from, [
  2. String to = ""
])

Replaces all occurrences of the given pattern with the replacement String.

Implementation

String replaceMany(Iterable<Pattern> from, [String to = ""]) {
  if (isEmpty) return blankIfNull;
  String result = this;
  for (var pattern in from) {
    result = result.replaceAll(pattern, to);
  }
  return result;
}