UNPKG
coffee-toaster
Version:
latest (0.6.13)
0.6.13
0.6.12
0.6.11
0.6.10
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.5
0.5.0
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.0
0.2.2
0.2.1
0.2.0
0.1.2
0.1.0
Minimalist build system for CoffeeScript.
serpentem/coffee-toaster
coffee-toaster
/
src
/
toaster
/
utils
/
string-util.coffee
12 lines
(8 loc)
•
266 B
text/coffeescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
class
StringUtil
@titleize:(
str
)->
words =
str
.
match
/[a-z]+/gi words[index] = StringUtil.ucasef word
for
word, index
in
words words.join
" "
@ucasef:(
str
)->
output =
str
.substr(
0
,
1
).toUpperCase() output +=
str
.substr(
1
).toLowerCase()