Skip to content

Commit 17148ca

Browse files
authored
Add files via upload
1 parent 2365cb3 commit 17148ca

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Assignment-10/RemoveWhiteSpace.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* PROGRAM : To remove all the whitespaces from a string
3+
* FILE : RemoveWhiteSpace.java
4+
* CREATED BY : Santosh Hembram
5+
* DATED : 14-10-2020
6+
*
7+
*/
8+
9+
import java.util.*;
10+
class RemoveWhiteSpace {
11+
12+
public static void main(String[] args) {
13+
14+
String str;
15+
System.out.print("Enter a string: ");
16+
Scanner sc = new Scanner(System.in);
17+
str = sc.nextLine();
18+
19+
str = str.replaceAll(" ","");
20+
21+
System.out.print("After Remove all the whitespaces from the string:");
22+
System.out.println(str);
23+
24+
}
25+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy