- A string utility library
- Small size
- Stat size: 2.33 KB
- Parsed size: 1.03 KB
- Gzipped size: 515 B
- Simple
This is an open-source project, feel free to contribute to this awesome project.
Best way to do this:
- Fork the project
- Create a branch
<current_version>-<github_username>-<keyword>. Example:1.0.0-smitpatelx-changesToIsEmpty - Make a pull request
- Make sure not to change version in package.json (That will be done in next release)
- NPM
npm i @smitpatelx/string-utils- Yarn
yarn add @smitpatelx/string-utils- CDN
<script src="https://cdn.jsdelivr.net/npm/@smitpatelx/string-utils@latest/src/lib/string-utils.js"></script>import {
left,
right,
camelize,
capitalize,
removeWhiteSpace,
escapeHtml,
isEmpty,
slugify
} from '@smitpatelx/string-utils';right('111 222 333 444 000', 3)
// Output
000left('111 222 333 444 000', 3)
// Output
111camelize('data_rate')
camelize('-git-xyz')
// Output
dataRate
GitXyzcapitalize('data')
capitalize('aPPLE')
// Output
Data
AppleremoveWhiteSpace('111\n222\t333\n444\n\t000')
removeWhiteSpace(' This \t is awesome \n\n\t library\n! ')
// Output
111 222 333 444 000
This is awesome library !escapeHtml('<div>stringUtils</div>')
// Output
<div>stringUtils</div>isEmpty('')
isEmpty('hi')
// Output
true
falseslugify('Save earth')
slugify('Crème brûlée')
// Output
save-earth
creme-brulee