Dart 中是否有类似 String.join()
的方法? Java和C#中的方法?
输入:
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
关于string - 如何在没有迭代的情况下在 Dart 中将 list<String> 转换为 String?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48014624/