How to replace all occurrences of multiple substring in a string with Dart

1 Answer

0 votes
void main() {
    var str = 'dart java c++ c java c++ php c++';
     
    str = str.replaceAll('java', 'python').replaceAll('c++', 'c#');;
 
    print(str);
}
 
 
 
 
/*
run:
 
dart python c# c python c# php c#
 
*/

 



answered Oct 14, 2022 by avibootz

Related questions

1 answer 133 views
1 answer 120 views
1 answer 135 views
1 answer 157 views
1 answer 163 views
1 answer 141 views
...