replaceAllIgnoreFirst method

String replaceAllIgnoreFirst(
  1. Pattern from,
  2. String replace
)

Implementation

String replaceAllIgnoreFirst(Pattern from, String replace) {
  bool isFirst = true;
  return replaceAllMapped(from, (Match match) {
    if (isFirst) {
      isFirst = false;
      return match.input.substring(match.start, match.end);
    } else {
      return replace;
    }
  });
}