您的当前位置:首页正文

C# Split 字符串转成List<int>

2024-11-29 来源:个人技术集锦
var sNumbers = "1,2,3,4,5,6"
List<int> numbers = sNumbers.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse).ToList();
显示全文