Answers for "replace all non numbers from a string in JAVA"

0

java remove non numbers from string

String str = "a12.334tyz.78x";
str = str.replaceAll("[^\\d.]", "");
Posted by: Guest on March-25-2020
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 "replace all non numbers from a string in JAVA"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language