I have String which contains some special characters and white spaces as well.I want to remove white spaces and special character I am doing it as
String str = "45,%$^ Sharma%$&^,is,46&* a$# java#$43 Developer$#$^ in#$^ CST&^* web*&(,but He%^&^% want to move@!$@# in another team";
System.out.println( str.replaceAll("[^a-zA-Z]", " ").replaceAll("\\s+"," "));
Output :- sharma is a java Developer in CST web but He want to move in another team
Can i do this using single operation? how?