how can get data from array in same way like i can in php?
$arr = array(
'123' => 'abc',
'456' => 'def'
);
echo $arr['123']; // abc
How can i do same with array's at C#?
how can get data from array in same way like i can in php?
$arr = array(
'123' => 'abc',
'456' => 'def'
);
echo $arr['123']; // abc
How can i do same with array's at C#?
That looks like a dictionary:
Dictionary<int, string> dict = new Dictionary<int, string>
{
{123, "abc"}, {456, "def"}
};
Console.WriteLine(dict[123]); // abc