If I have an array and perform a ToString() does that just string together the array values in one long comma seperated string or is that not possible on an arr
You can use string.Concat(Object[] args). This calls the ToString() method of every object in args. In a custom class you can override the ToString() method to achieve custom string conversion like this:
public class YourClass
{
private int number;
public YourClass(int num)
{
number = num;
}
public override string ToString()
{
return "#" + number;
}
}
Now you can concatenate an array of instances of your custom class:
YourClass[] yourArray = { new YourClass(1), new YourClass(2), new YourClass(3) };
string concatenated = string.Concat(yourArray);
Unfortunately this method does not add any delimiters, but I found it to be elegant. The variable concatenated will contain "#1#2#2".