End Google Ads 201810 - BS.net 01 --> Alright, so i got an array like this:

String[] Arr = { "A, B, C", "B, A, C", "C, A", "B, C, A", "D, A, N, V", "N, W, B, A"};I am trying to extract unique values / remove duplicates from this array, so in the end the output will be like:

A, B, C, D, N, V, W

Now here is my function:

public static String[] Extract(String[] List)
{
String[] Output = null;
String Symbols = String.Empty;
String SymbolsHere = String.Empty;

foreach (String Text in List)
{
if (Text.Contains(","))
{
String[] Vals = Text.Split(new char[] { ',' });
foreach (String Val in Vals)
{
if (SymbolsHere.IndexOf(Val) == -1)
{
// MessageBox.Show(SymbolsHere, Val);
SymbolsHere += Val + " ";
Symbols += Val + ", ";
}
}
}
else
{
if (SymbolsHere.IndexOf(Text) == -1)
{
Symbols += Text + ", ";
SymbolsHere += Text + " ";
}
}
}
// MessageBox.Show(SymbolsHere);
MessageBox.Show(Symbols);
return Output;
}Well, this almost works, but...
Last messagebox shows "A, B, C, A, D, N, V, W" instead of "A, B, C, D, N, V, W", so as you can see, one extra "A" char gets into output and i got no idea why

Take a look at this part:
if (SymbolsHere.IndexOf(Val) == -1)
{
MessageBox.Show(SymbolsHere, Val);
SymbolsHere += Val + " ";
Symbols += Val + ", ";
}
So, like, if symbol has not been found in already collected symbols container, show
symbols container itself and a new symbol. But, at this moment app pops a msgbox with collection of syms: A B C and new symbol,
which is not found in our collection: A.
Its like, absurd - A is already there
What is wrong with this code? Thanks
011011010110000101100011011010000110100101101110
0110010101110011