I am having a hashtable which contains keys of Strings.
Now i want to check whether a
string which will be a substring of any
of the keys of the hashtable is present in the hashtable or not.
For example suppose i am having a key like
"firstpart-secondpart-thirdpart".
Now i want to retrieve a table based on whether "firstpart-secondpart" is present as a
substring of any of the keys or not(in this case it is).
one way to do it is calling keys() method of the hashtable and then
looping through all elements of the enumeration and invoking indexOf()
method of String class.
But i do not want a while or for loop.
Is there any other class in
Java API which can help me through this ?