- forEach() expression.
- iterator property to get Iterator that allows iterating.
- every() method
- simple for-each loop
- for loop with item index
forEach() expression:
void main()
 {
var myList = [0, 'one', 'two', 'three', 'four', 'five'];
myList.forEach((item) => print(item));
 }Output:
0
one
two
three
four
fiveIterator property to get Iterator that allows iterating:
void main()
 {
     var myList = [0, 'one', 'two', 'three', 'four', 'five'];
     var listIterator = myList.iterator;
     while (listIterator.moveNext()) {
     print(listIterator.current);
     }
 }Output
 0
one
two
three
four
fiveevery() method:
 void main()
 {
     var myList = [0, 'one', 'two', 'three', 'four', 'five'];
     myList.every((item) {
     print(item);
     return true;
     });
 }Output
0
one
two
three
four
fivesimple for-each loop:
void main()
 {
     var myList = [0, 'one', 'two', 'three', 'four', 'five'];
     for (var item in myList) {
     print(item);
     }
 }Output
0
one
two
three
four
fivefor loop with item index:
void main()
 {
     var myList = [0, 'one', 'two', 'three', 'four', 'five'];
    for (var i = 0; i < myList.length; i++) {
    print(myList[i]);
     }
 }Output
0
one
two
three
four
fiveHow to Replace a Substring of a String in Dart?
main() {
    String data = "welcome";
      
    //replace substring of the given string
    String result = data.replaceAll("hii", "Abhishek!");
      
    print(result);
}
OutPut
hii Abhishek!

I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains:
- 
DevOps School – Tech blogs and tutorials 
- 
Holiday Landmark – Travel stories and guides 
- 
Stocks Mantra – Stock market strategies and tips 
- 
My Medic Plus – Health and fitness guidance 
- 
TrueReviewNow – Honest product reviews 
- 
Wizbrand – SEO and digital tools for businesses 
I’m also exploring the fascinating world of Quantum Computing.