I have a list of strings:
//TODO: Put these lists in a separate method
public static List<string> task1GetNames = new List<string>(new[]
{
"Gru",
"Bob",
"Peter
});
Then I have another list that I use to store the values of the first list in it
public static List<string> selection = new List<string>();
In another class I am saving the contents of the first list into the new list
MyClass.selection.Add(MyClass.task1GetNames[MyClass.randomIndex_task1]);
After that I place the contents of the list into this string array:
string[] myNameList = { MyClass.selection.ToString(),
MyClass.selection.ToString(),
MyClass.selection.ToString()
};
But the output I see is System.GenericList1… on all three ouputs.
And finally I pass the strings into a selection grid so that they are printed onto the screen:
drawSelectionGrid(selGrid_NameOptions, myNameList, ref nameIndex, 3);
The issue I’m having is that the output is coming out wrong, it is like it is giving me some systems application debug information and not the names I listed above in the string list. What can I do in order to get all names to output correctly?