replaceAll method
Replaces all substrings that match from
with replace
.
Creates a new string in which the non-overlapping substrings matching from
(the ones iterated by from.allMatches(thisString)
) are replaced by the literal string replace
.
'resume'.replaceAll(RegExp(r'e'), 'é'); // 'résumé'
Notice that the replace
string is not interpreted. If the replacement depends on the match (for example on a RegExp's capture groups), use the replaceAllMapped method instead.
Implementation
String replaceAll(Pattern from, String replace);
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-core/String/replaceAll.html