/** * */package com.onlinecodegeek.java.util;/** * @author tponnam * */public class ReplaceNonAlphabetsInString { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String str = "Hello & World @# .. World of &2 Java"; str = str.replaceAll("[^a-zA-Z]+", ""); System.out.println(str.trim()); }}
-
Blogger Comment
-
Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment