[Dart] splitMapJoin

  var str3 = '''Multi
  Line
  String''';

  print( str3.splitMapJoin(
      RegExp(r'^', multiLine: true), // Matches the beginning of the line
      onMatch: (m) => '** ${m.group(0)}', // Adds asterisk to match
      onNonMatch: (n) => n // Just return non-matches
  ) ); 

/* ** Multi ** Line ** String*/
原文地址:https://www.cnblogs.com/Answer1215/p/11459347.html