string[] strarry = ids.Trim(',').Split(','); int[] arryInts = Array.ConvertAll<string, int>(strarry, int.Parse);