Skip to content

Commit 6988248

Browse files
authored
Add Remove All Whitespace in CoffeeScript (#5181)
1 parent ab47287 commit 6988248

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
removeAllWhitespace = (inputString) ->
3+
return usage() if not inputString
4+
words = inputString.split(/[\s]+/)
5+
finalString = ''
6+
for word in words
7+
finalString += word
8+
return finalString
9+
usage = () ->
10+
"Usage: please provide a string"
11+
12+
main = () ->
13+
args = process.argv
14+
return removeAllWhitespace(args[2])
15+
16+
console.log main()

0 commit comments

Comments
 (0)