I'm trying to write a very basic program to return the value of 2 elements in an array of string but the output is System.String[] instead of the actual value of the string. Is it because I have it two letters associated to 1 element. For example :
static void Main(string[] args)
{
string[] a = new string[2] { "ugly string", "lovely string" };
foreach (var item in a)
{
Console.WriteLine(a);
}
}
It should return ugly string and lovely string in two separate lines. However it's just showing System.String[] in 2 different lines.
Console.WriteLine(item), notConsole.WriteLine(a)