Start by splitting the string:
string[] parts = "1,2,3-8,9".Split(',');
You can then set up a List<int> to transfer the digits into.
Loop through each substring, and check if it contains a '-' - string.Contains is your friend here.
If it doesn't, use int.TryParse to convert the string to an integer, and it it passes, add to your list.
If it does contain a hyphen, use Split again to separate it, convert the two numbers to integers, and use Enumerable.Range to convert it to a range of values. You can use the List.AddRange to add them directly.