steve_mick972
asked on
HashTable Remove - Search Functionality.
Hi,
Here is my Hashtable.
HasTable myHash = new HashTable();
myHash.Add("~Chapter1-exam ple1","A") ;
myHash.Add("~Chapter1-exam ple2","B") ;
myHash.Add("~Chapter1-exam ple3","C") ;
myHash.Add("~Chapter1-exam ple4","D") ;
myHash.Add("~Chapter2-exam ple1","A") ;
myHash.Add("~Chapter2-exam ple2","B") ;
myHash.Add("~Chapter2-exam ple3","C") ;
myHash.Add("~Chapter2-exam ple4","D") ;
myHash.Add("~Chapter2-exam ple5","E") ;
How can i remove all elements with key = "~Chapter1-"
kind of like a partial search, just want to remove all the keys, that start with the following key.
thanks,
steve.
Here is my Hashtable.
HasTable myHash = new HashTable();
myHash.Add("~Chapter1-exam
myHash.Add("~Chapter1-exam
myHash.Add("~Chapter1-exam
myHash.Add("~Chapter1-exam
myHash.Add("~Chapter2-exam
myHash.Add("~Chapter2-exam
myHash.Add("~Chapter2-exam
myHash.Add("~Chapter2-exam
myHash.Add("~Chapter2-exam
How can i remove all elements with key = "~Chapter1-"
kind of like a partial search, just want to remove all the keys, that start with the following key.
thanks,
steve.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
myHashCh1.Add("example1","
myHashCh1.Add("example2","
myHashCh1.Add("example3","
myHashCh1.Add("example4","
myHashCh2.Add("example1","
myHashCh2.Add("example2","
myHashCh2.Add("example3","
myHashCh2.Add("example4","
myHashCh2.Add("example5","
myHash.Add("~Chapter1-", myHashCh1);
myHash.Add("~Chapter2-", myHashCh2);