Ranish
Ranish

Reputation: 337

split a string and save sub strings in list in dart

I have a long String that contains comma-separated values. How can I split that string and save those substrings into List in dart/Flutter? enter image description here

Please help me to do this

String myname = dd.data.toString();

Upvotes: 0

Views: 1720

Answers (1)

Tipu Sultan
Tipu Sultan

Reputation: 1875

You can use split for this.

String s = "a,b,c,d,e";

List<String> list = s.split(",");

Upvotes: 3

Related Questions