Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java separate 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);
 
PREVIOUS NEXT
Tagged: #java #separate #numbers #string
ADD COMMENT
Topic
Name
2+7 =