Java examples for java.lang:String Replace
replace Letter from a String using Regex
//package com.java2s; public class Main { public static void main(String[] argv) { String content = "java2s.com"; System.out.println(replaceLetter(content)); }//from www. ja v a 2 s . c o m public static String replaceLetter(String content) { String strMark = "[^[A-Za-z]+$]"; String strContent = ""; strContent = content.replaceAll(strMark, ""); return strContent; } }