Hi everyone,
I'm getting the following error:
Cannot apply indexing with [] to an expression of type 'System.Array'
I'm trying to print out the first element of the array as a string. Can someone explain what the error message means?
using System;
using System.Collections.Generic;
public class MyClass
{
public static void RunSnippet()
{
string s = "12 23 34 45 56 67 34 45 56";
Array a = s.Split(' ');
Console.WriteLine(a[0]);
Console.ReadKey();
}
}