Is there a way to compare the keys in a hashtable to a string? I need to find out if any key is found anywhere in a string. I know with a string you can use indexOf() to see if one string is a substring of another but how do you traverse a hashtable in order to do the same thing? I how this is clear...it's the only way I know how to explain it.
Map.keySet() will give you all the keys in the Map. The remaining work is up to you... [ August 23, 2002: Message edited by: Ilja Preuss ]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Charmaine Gatling: So, I'd basically have to store the key into a list (array) in order to compare each one to the string? Then what does the containsValue() method do?
Contains value tells you if the object is found in the value part of the hashtables key-value pair. It does not check if the value contains something. It checks to see if the hashtable contains some value.