Monday, July 27, 2009

Remove whitespaces or whatever letter from a string in Java

String str = "Helloo , Welcome to the land of FRACK !!!".replaceAll(" ", "!"));

str will be : Helloo!,!Welcome!to!the!land!of!FRACK!!!!

No comments: