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 123 views
1 answer 138 views
1 answer 158 views
1 answer 164 views
2 answers 210 views
...