public List digits = new List(); public List words = new List(); public int GetDigitsLength(string line) { int i1 = 0; for(int i = 0; i < line.Length; i++) { if (char.IsDigit(line[i])) i1++; else return i1; } return i1; } public string ParseLines(string[] lines) { for (int i = 0; i < lines.Length; i++) { int l = GetDigitsLength(lines[i]); int digit = int.Parse(lines[i].Remove(l)); if (!digits.Contains(digit)) { words.Add(lines[i].Substring(l)); digits.Add(digit); } } string output = ""; for (int i2 = 0; i2 < words.Count; i2++) { output += words[i2]+"\r\n"; } return output; }