We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2365cb3 commit 17148caCopy full SHA for 17148ca
Assignment-10/RemoveWhiteSpace.java
@@ -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