List<string> result = new List<string>(); foreach(string st in richTextBox1.Lines) { try { result.Add(st.Split(':')[0]); } catch { } }