Skip to content

Commit cbde95c

Browse files
authored
Add Capitalize in CoffeeScript (#5173)
1 parent d782dfb commit cbde95c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Usage = "Usage: please provide a string"
2+
3+
capitalize = (arg) ->
4+
charList = []
5+
for char, i in arg
6+
if i == 0
7+
charList.push(char.toUpperCase())
8+
else
9+
charList.push(char)
10+
return charList.join("")
11+
12+
main = () ->
13+
args = process.argv[2]
14+
if args
15+
capitalize(args)
16+
else
17+
return Usage
18+
19+
console.log main()

0 commit comments

Comments
 (0)