I have a Treemap with Strings as keys. I want to get all the values whose keys start with the String search.
I think what I need to do here is something like:
myTreeMap.subMap(search.concat(X1), true, search.concat(X2), true);
where X1 and X2 are the highest and lowest possible character.
Is there a better approach? If not, what are X1 and X2?
Thanks in advance.
basically you need lexicographically next prefix as the second boundary: