OK, here is the problem that I am having at the moment: I want to unify same array's elements with each other.
For example: I have an array with these elements "A", "B", "C", "D"
And I want to unify them (possibly then putting them in another List) so it would become:
A,B
A,C
A,D
B,C
B,D
C,D
So far, I have tried a simple for loop but with no success and couldn't think of how to approach this further.
Here is so far what I have tried with no success:
List<string> testList = new List<string>();
List<string> anotherList = new List<string>();
testList.AddRange(richTextBox1.Text.Split(','));
anotherList.ToArray();
for (int i = 0; i < testList.Count; i++) //no idea how to get the right count
{
var union = testList[i].Union(testList[i+1]);
foreach (char value in union)
{
richTextBox2.Text = value.ToString();
}
}
Thanks.