SyntaxFix
Write A Post
Hire A Developer
Questions
With guava:
String input = "abx123.5"; String result = CharMatcher.inRange('0', '9').or(CharMatcher.is('.')).retainFrom(input);
see http://code.google.com/p/guava-libraries/wiki/StringsExplained