Can you do
array[\'Name\'];
In C#
Rather than:
array[0];
I know you can do that in PHP but is there a
it's called a Dictionary in C#. Using generics you can actually index by any type. Like so:
Dictionary dictionary = new Dictionary();
Person myPerson = new Person();
dictionary[myPerson] = "Some String";
...
string someString = dictionary[myPerson];
Console.WriteLine(someString);
This obviously prints, "Some String" to the console.
This is an example of the flexibility of the dictionary. You can do it with a string as an index too, like you asked for.