在Dart中是否有Java和C#中的方法String.join()?
输入:
nums:[“20”,“3005”,“2”]
输出:
nums =“2030052”
最佳答案
join
是List类的方法,而不是String:
List<String> yourList = ["20", "3005", "2"];
// To test that the above the above
yourList.join() == '2030052'; // true
yourList.join(',') == '20,3005,2'; // true, with "," delimiter