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

1 Answer

0 votes
void main() {
    var str = 'dart java c++ c java';
    
    str = str.replaceAll('java', 'python');

    print(str);
}




/*
run:

dart python c++ c python

*/

 



answered Oct 13, 2022 by avibootz

Related questions

1 answer 120 views
1 answer 135 views
1 answer 157 views
1 answer 163 views
2 answers 204 views
...