Java examples for java.util.regex:Match Number
replace Number using Regex
//package com.java2s; public class Main { public static void main(String[] argv) { String content = "java2s.com"; System.out.println(replaceNumber(content)); }//from www .java2 s. c o m public static String replaceNumber(String content) { String strMark = "[^[0-9]+$]"; String strContent = ""; strContent = content.replaceAll(strMark, ""); return strContent; } }