strility
Strility is a string manipulation library
[Work in progress]
Usage
$ npm i --save strility
Api
const isUpperCase = ;
- string, the input string.
- returns true or false
const isLowerCase = ;
- string, the input string.
- returns true or false
const isString = ;
- string, the input string.
- returns true or false
// Uses the Fisher-Yates algorithmconst shuffle = ; // 'trsgni'
- string, the input string.
- returns shuffled string
const chars = ; // [ 's', 't', 'r', 'i', 'n', 'g' ]
- string, the input string.
- returns array of characters
const surround = ; // '*dog*'
- string, the input string.
- surround, the substring to surround the input string
- returns surrounded string
const replaceAll = ; ;// The sleepy brown fox jumps over the lazy cat
- string, the input string.
- search, the array of search strings
- replace, the array of replace strings
- returns replaced string
const swapCase = ; // 'mY string HAS upper case AND LOWER CASE'
- string, the input string.
- returns swapped lower/upper case string
Between is an among proxy
const between = ; const find = ; // [ 'fox', 'dog' ]
Tests
$ npm test
Contribution
Contributions are appreciated.
License
MIT-licensed. See LICENSE.