string[] source = textBox1.Lines; Dictionary<string, bool> dic = new Dictionary<string, bool>(); foreach (string s in source) dic[s] = true; string[] target = new string[dic.Count]; int index = 0; foreach (string s in dic.Keys) target[index++] = s; textBox1.Lines = target;
string[] source = textBox1.Lines;
Dictionary<string, bool> dic = new Dictionary<string, bool>();
foreach (string s in source)
dic[s] = true;
string[] target = new string[dic.Count];
int index = 0;
foreach (string s in dic.Keys)
target[index++] = s;
textBox1.Lines = target;