Entry
Writing a PERL hash the C# way
Feb 22nd, 2004 18:19
Cleave Pokotea - www.makethingstalk.co.nz,
I would like to Initialize Hash (Array?) Elements in C# as in perl e.g:
my %KeyVal = (1, "A",2, "B");
That is, with mixed types. Is this possible?
I know in C# you can do:
Hashtable hTable = new Hashtable();
hTable.Add("1","A");
hTable.Add("2","B");
to create a hash, but is the following possible?
namespace x{
public class xC{
prinvate Hashtable xHashTable = (1, "A", 2, "B");
public xC{
// use xHashTable somehow ...
}
}
}