public static void Main()
var listString = "1,2,50-60,99";
var newList = new StringBuilder();
var arr = listString.Split(',');
if(Int32.TryParse(pair[0], out xfrom) && Int32.TryParse(pair[1], out xto) )
throw new Exception("Segment greater than 1000: " + s );
for (int i = xfrom; i <= xto; i++)
newList.AppendFormat("{0},", i);
newList.AppendFormat("{0},",s.Trim());
Console.WriteLine("Result: {0}", newList);