S
Stryder
I'm trying to do a lot (several hundred) of replacements in a string.
These are just string replacements I'm trying to do, not regular
expressions. Here's the WRONG way to do it, but hopefully it tells
you what it is I'm trying to do...
static String unescapeString(String string) {
Iterator i = entitiesHashMap.keySet().iterator();
for (String key : entitiesHashMap.keySet()) {
string = string.replaceAll(key, (String)
entitiesHashMap.get(key));
}
return string;
}
entitiesHashmap is a HashMap with literally hundreds of entries.
Any help would be greatly appreciated.
These are just string replacements I'm trying to do, not regular
expressions. Here's the WRONG way to do it, but hopefully it tells
you what it is I'm trying to do...
static String unescapeString(String string) {
Iterator i = entitiesHashMap.keySet().iterator();
for (String key : entitiesHashMap.keySet()) {
string = string.replaceAll(key, (String)
entitiesHashMap.get(key));
}
return string;
}
entitiesHashmap is a HashMap with literally hundreds of entries.
Any help would be greatly appreciated.