[英]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?如何拆分该字符串并将这些子字符串保存到 dart/Flutter 中的 List 中?
Please help me to do this请帮我这样做
String myname = dd.data.toString();
You can use split for this.您可以为此使用拆分。
String s = "a,b,c,d,e"; List<String> list = s.split(",");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.