public static String removeNonDigits(final String str) {
if (str == null || str.length() == 0) {
return "";
}
return str.replaceAll("/[^0-9]/g", "");
}
This should only get the Digits and return but not doing it as expected! Any suggestions?