public
class
RemoveSpace {
public
static
void
main(String[] args) {
String
s="hello hai this is
karthik";
System.out.println(
s.replaceAll("\\s+",
" "));
}
}
//input:hello
hai this is karthik
//output:hello
hai this is karthik
No comments:
Post a Comment