I need to replace some characters in a string: Each DOT for underscore.
Just do: myString.replace(".","_"); which is working.
However, I want to use CharMatcher from Guava, which should have better performance.
CharMatcher dotCharMatcher = CharMatcher.anyOf("."); dotCharMatcher.replaceFrom(myString, "_");
It runs on a server with lots of threads.
Can I make dotCharMatcher static field in a class that uses it, or do I need to create it in every request? (is he safe?)
thanks
source share