replaceFrom method

String replaceFrom(
  1. String sequence,
  2. String replacement
)

Replaces each matched character in sequence with the specified replacement.

Implementation

String replaceFrom(String sequence, String replacement) =>
    String.fromCharCodes(sequence.runes
        .expand((value) => match(value) ? replacement.runes : [value]));