private void ParseRules() { for (int i = 0; i < input.Length; i++) { if (input[i] == string.Empty) { break; } TicketRule r = new TicketRule(); string[] parts = input[i].Split(": ", 2); r.Name = parts[0]; string[] ab = parts[1].Split(" or "); r.RangeA.Start = int.Parse(ab[0].Split('-')[0]); r.RangeA.End = int.Parse(ab[0].Split('-')[1]); r.RangeB.Start = int.Parse(ab[1].Split('-')[0]); r.RangeB.End = int.Parse(ab[1].Split('-')[1]); Rules.Add(r); } }