using System.Collections.Generic;
public static void Main()
var word = "deals-dev-us-ny-01";
var list = new List<string>();
var searchStartIndex = 0;
while((foundIndex = word.IndexOf('-', searchStartIndex)) != -1) {
list.Add(word.Substring(0, foundIndex));
searchStartIndex = foundIndex + 1;
Console.WriteLine(string.Join(",", list));