Answers for "java replace all not number"

0

java replace all not number

public static String removeNonDigits(final String str) {
   if (str == null || str.length() == 0) {
       return "";
   }
   return str.replaceAll("/[^0-9]/g", "");
}
Posted by: Guest on March-19-2021

Code answers related to "java replace all not number"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language