Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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", "");
}
Comment

PREVIOUS NEXT
Code Example
Java :: Cannot invoke toString() on the primitive type int 
Java :: swing setbounds 
Java :: string array to string java 
Java :: spigot kill entity 
Java :: check have string have just numbers 
Java :: write input stream to file java 
Java :: why are there no destructors in java? 
Java :: java list contains object with property 
Java :: convert fahrenheit to celsius 
Java :: java arraylist print 
Java :: permission foreground_service 
Java :: error cannot find symbol intent 
Java :: android dismiss keyboard 
Java :: Islands count leetcode 
Java :: java mp3 player 
Java :: java distinct by key 
Java :: string reverse in java 
Java :: charcodeat java 
Java :: filtering out unique values from a list in java 
Java :: running sum of 1d array java 
Java :: add opacity to activity android 
Java :: how to get data from radio group in android 
Java :: array java 
Java :: maven paper 
Java :: build.plugins.plugin.version 
Java :: arrays.aslist 
Java :: java string static arrat 
Java :: how to return array in java 
Java :: get length of a string java 
Java :: sum of array elements java 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =