Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java isolate the numbers from string

        // string contains numbers
        String str = "The price of the book is $49";
        // extract digits only from strings
        String numberOnly = str.replaceAll("[^0-9]", "");
        // print the digitts
        System.out.println(numberOnly);
Comment

PREVIOUS NEXT
Code Example
Java :: parse string to int java 
Java :: variable between two numbers java 
Java :: add stringarrays to string list java 
Java :: How to use Runnable interface to develop multi-threaded Java programs? 
Java :: initialize hashset with values java 9 
Java :: float maximum value java 
Java :: count vowels in java 
Java :: java lowercase 
Java :: java make all interfaces implement another 
Java :: how to check whether a character is alphabet or not in java 
Java :: why are there no destructors in java? 
Java :: comparable on a generic class java 
Java :: java bukkit double jump 
Java :: how to send a byte array in socket java 
Java :: literals in java 
Java :: remove all new line and other in string using java 
Java :: for loop java 
Java :: how to initialize a set in java 
Java :: double quotes in string java 
Java :: charcodeat java 
Java :: how to find a word in string in java 
Java :: cannot find symbol variable log 
Java :: how to declare and insert value to arraylist in same line in java 
Java :: spannable string in android java for color 
Java :: java replaceAll ignore case 
Java :: how to find location of java jdk 
Java :: random boolean java 
Java :: how to make a loop in java 
Java :: template competitive programming java 
Java :: java stream get all max values 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =