private void SplitString()
{
ArrayList splitted = new ArrayList();
string[] words = richTextBox1.Text.Split(new char [] { ' ' },
StringSplitOptions.RemoveEmptyEntries);
var word_query =
(from string word in words
orderby word
select word).Distinct();
string[] result = word_query.ToArray();
foreach(string results in result)
{
richTextBox2.Text = results;
}
}
I wrote a form application for taking a text file and splitting strings at the file. And the final purpose is writing unique strings on textbox. The problem is strings flow quickly on textbox but i like to stand them on textbox.
richTextBox2.Text = string.Join(" ", richTextBox1.Text.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Distinct().OrderBy(w => w));