"BCM" <BCM (AT) email (DOT) none> wrote
Quote:
How do you reset a value for an existing key in a hashtable? I need to
create a collection and compare the values with another collection: when
certain parameters are met then I need to reset the value of certain
elelments in the first collection.
I would have thought that the Hashtable.Item property would do the
trick, as MSDN defines it as "Gets or sets the value associated with the
specified key". But the actual documentation is so obtuse it's just silly: http://msdn.microsoft.com/library/de...sitemtopic.asp
Thanks in advance. |
Perhaps this example from John Skeet will help:
<quote>
It's an indexer - you need to use the indexer syntax:
Hashtable foo = new Hashtable();
foo["hello"]="there"; // Effectively foo.set_Item("hello", "there")
Console.WriteLine (foo["hello"]); // Using foo.get_Item("hello")
<unquote>
--
Peter [MVP Visual Developer]
Jack of all trades, master of none.