W3cubDocs

/Dart 2

replaceAll method

String replaceAll (Pattern from, String replace)

Replaces all substrings that match from with replace.

Returns 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(new 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.dartlang.org/stable/2.0.0/dart-core/String/replaceAll.html