C# Split 字符串转成List

var sNumbers = "1,2,3,4,5,6";
List<int> numbers = sNumbers.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse).ToList();

  

posted @ 2019-06-01 23:57  86727515  阅读(4218)  评论(0编辑  收藏  举报