0

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();
3
  • It is not entirely clear! Can you describe the expected result? Commented Aug 22, 2020 at 15:21
  • I need cooma separed values from the above string.....example-> brand:sfdfgdf Commented Aug 22, 2020 at 15:26
  • So, I believe answer of @Tipu answers your question! Commented Aug 22, 2020 at 15:32

1 Answer 1

3

You can use split for this.

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

List<String> list = s.split(",");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.