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]; }
时间: 2024-10-23 17:00:10
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]; }