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*/