Android examples for java.util.regex:Character Pattern
Remove all alpha characters from a string by using regex
public class Main{ /**/* w w w . j a v a 2 s.c om*/ * Remove all alpha characters from a string * @param str String to parse * @return Return a string without alpha characters, only numeric characters */ public static String removeAlphaCharacters(String str) { return str.replaceAll("[^\\d.]", ""); } }