Fast Substring Match in Hash without Iterating?

  • Thread starter Thread starter bdwise
  • Start date Start date
B

bdwise

I have a hash table with key/value like this:

aaaa 1
aa 2
bbbb 3

I am iterating over a datatable and trying to search and replace
values in it based on a match in the hashtable. I have values in the
datatable like this:

aa
aaaa
bbbb
bb

I want to change the datatable values to be

2
2aa
3
bb


Do I have to iterate over the entire hash each time with a for or
foreach, or is there a smarter way?
 
Can you clarify what you're doing? Why would 'aaaa' change to '2aa' since
you have aaaa=1 in your hash table?
 
Back
Top