//How to remove spaces from line in java
public class M
{
public static void main(String args[])
{
String line="Hello! How are you?";
System.out.println("Remove spaces: "+line.replaceAll(" ", ""));
}
}
OUTPUT:
Remove spaces: Hello!Howareyou?
public class M
{
public static void main(String args[])
{
String line="Hello! How are you?";
System.out.println("Remove spaces: "+line.replaceAll(" ", ""));
}
}
OUTPUT:
Remove spaces: Hello!Howareyou?
No comments:
Post a Comment