string a="1,2,3,4,5,6,7"; string[] pid = a.Split(','); int[] ps = Array.ConvertAll<string, int>(pid, s => int.Parse(s));