Android examples for java.lang:String Convert
get Only Digits From String
public class Main{ public static String getOnlyDigitsFromString(String textWithDigits) { if (isNullOrEmpty(textWithDigits)) { return ""; }//from w w w . ja v a 2 s.c om return textWithDigits.replaceAll("\\D", ""); } }