$ npm install ustring
npm install ustring
var ustring = require('ustring')
ustring.toLowerFirst('ABC') == 'aBC'
ustring.toUpperFirst('abc') == 'Abc'
ustring.hyphenate('ThisIsMyWord') == 'this-is-my-word'
ustring.humanize('This_is-a-very-long-sentence') == 'This is a very long sentence'
ustring.camelize('This-is-a-very-long-word') == 'ThisIsAVeryLongWord'
ustring.endsWith('hello world','world') == true
ustring.endsWith('hello world','wor') == false
ustring.endsWith(123, 3) == true
ustring.is.alphanum('abcd09') == true
ustring.is.alphanum('abcd09#%#$') == false
ustring.is.match(/^[a-zA-Z0-9]+$/, 'abcd09') == true
ustring.is.match(/^[a-zA-Z0-9]+$/, 'abcd09#%#$') == false
Since match is a curried fn, you can even write
var matches = ustring.is.match(/^[a-zA-Z0-9]+$/)
matches('abc')
make
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE