var sNumbers = "1,2,3,4,5,6";List<int> numbers = sNumbers.Split(new char[]{
','},StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse).ToList();
C# Split 字符串转成List<int>
最新推荐文章于 2024-09-27 16:41:41 发布
var sNumbers = "1,2,3,4,5,6";List<int> numbers = sNumbers.Split(new char[]{
','},StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse).ToList();