/**
* @author lautturi.com
* Java example: remove all non digit characters in java string
*/
import java.util.*;
public class Lautturi {
public static void main(String[] args) {
String str = "hello 123 world 1auttur12456 ";
str = str.replaceAll("\\D", "");
System.out.println(str);
}
}Source:www.lautturi.comoutput:
123112456