replaceMapValue static method

String replaceMapValue(
  1. String string,
  2. Map<String, String> mapPattern
)

Implementation

static String replaceMapValue(String string, Map<String, String> mapPattern) => string.replaceAllMapped(
      RegExp(mapPattern.keys.join('|'), caseSensitive: false),
      (match) => mapPattern[match.group(0)]!,
    );