When using the .ToArray()
function is it necessary to implicitly define the size of the array in order to hold of the characters that were in the list you're converting?
String [] array = List.ToArray();
I tried doing this because I needed to use the .GetValue()
ability of the array, however, the array is maintaining a size of 1 and not holding the material from the list. Am I trying to use the .ToArray()
incorrectly?
colAndDelimiter = new List<string>();
colAndDelimiter.Add(text);
String [] cd = colAndDelimiter.ToArray();
This is all of the code I have that effects the array. When I Console.WriteLine()
the list it gives me the entirety of the text. I may be confused about how list works. Is it storing everything as a single item, and that's why the array only shows one place?