import java.util.*;
class RemoveWhiteSpaceFromString
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter your string");
String s=sc.nextLine();
System.out.println();
System.out.println("Removing Whitespaces");
System.out.println();
s=s.replaceAll("\\s+","");
System.out.println(s);
}
}
Comments
Post a Comment