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 b2b4c96 commit d53ee2eCopy full SHA for d53ee2e
RemoveWhiteSpacesString.js
@@ -0,0 +1,18 @@
1
+/**
2
+ * Ways to remove white spaces from a string:
3
+ */
4
+const removeWhiteSpaces = (x) => {
5
+ return x.replace(/\s+/g, '')
6
+}
7
+
8
+const newString = "This is a string."
9
10
+console.log(removeWhiteSpaces(newString))
11
12
+ * Thisisastring.
13
14
15
+console.log(newString.split(' ').join(''))
16
17
18
0 commit comments