Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Semrush - keyword research tool

Linux Foundation Training and Certification

Teach Your Child To Read

Disclosure: My content contains affiliate links.

32,309 questions

42,484 answers

573 users

How to create a string with newlines in Dart

1 Answer

0 votes
void main() {
    var str = "dart\njava\nc#\nc\npython";
    
    List<String> lines = str.split("\\R");
    
    for (var line in lines) {
        print(line);
    }
}




 
/*
run:
   
dart
java
c#
c
python

*/

 



Learn & Practice Python
with the most comprehensive set of 13 hands-on online Python courses
Start now


answered May 30, 2023 by avibootz

Related questions

1 answer 53 views
53 views asked Jun 11, 2023 by avibootz
1 answer 47 views
47 views asked Apr 18, 2023 by avibootz
2 answers 64 views
...