用逗号分隔的数据转换到数组

string disIds = "1,2,3,4,5,6,7,8,9,";
string[] filePath = disIds.Split(',');

//去掉最后一位空值
string[] filePath2 = new string[filePath.Length - 1];
     for (int i = 0; i < filePath.Length-1; i++)
     {
         filePath2[i] = filePath[i];
     }
原文地址:https://www.cnblogs.com/JarvisNote/p/5064582.html