npm.io
1.4.1 • Published 11 years ago

ustring

Licence
MIT
Version
1.4.1
Deps
2
Vulns
0
Weekly
0

String utility methods

Installation

npm install ustring

API

var ustring = require('ustring')
toLowerFirst
ustring.toLowerFirst('ABC') == 'aBC'
toUpperFirstFirst
ustring.toUpperFirst('abc') == 'Abc'
hyphenate
ustring.hyphenate('ThisIsMyWord') == 'this-is-my-word'
humanize
ustring.humanize('This_is-a-very-long-sentence') == 'This is a very long sentence'
camelize
ustring.camelize('This-is-a-very-long-word') == 'ThisIsAVeryLongWord'
endsWith
ustring.endsWith('hello world','world') == true
ustring.endsWith('hello world','wor') == false
ustring.endsWith(123, 3) == true
is.alphanum
ustring.is.alphanum('abcd09') == true
ustring.is.alphanum('abcd09#%#
is.match
ustring.is.match(/^[a-zA-Z0-9]+$/, 'abcd09') == true
ustring.is.match(/^[a-zA-Z0-9]+$/, 'abcd09#%#

Since match is a curried fn, you can even write

var matches = ustring.is.match(/^[a-zA-Z0-9]+$/)
matches('abc')
Tests
make
License

MIT

) == false
is.match
__CODE_BLOCK_8__

Since match is a curried fn, you can even write

__CODE_BLOCK_9__
Tests
__CODE_BLOCK_10__
License

MIT

) == false

Since match is a curried fn, you can even write

__CODE_BLOCK_9__
Tests
__CODE_BLOCK_10__
License

MIT

) == false
is.match
__CODE_BLOCK_8__

Since match is a curried fn, you can even write

__CODE_BLOCK_9__
Tests
__CODE_BLOCK_10__
License

MIT

Keywords