@emzra/string-library
v1.0.0
Published
A collection of useful string manipulation functions.
Downloads
4
Readme
Em's String Library
A collection of useful string manipulation functions.
Installation
npm install ems-string-library
Usage
const stringUtils = require('ems-string-library');
console.log(stringUtils.capitalize('hello world')); // Hello world console.log(stringUtils.kebobCase('Hello World')); // hello-world
API
capitalize(str) Makes the first character of a given string uppercase.
allCaps(str) Makes all characters uppercase.
capitalizeWords(str) Makes the first character of each word uppercase.
removeExtraSpaces(str) Removes all extra spaces from the string.
kebobCase(str) Converts string to kebab-case.
snakeCase(str) Converts string to snake_case.
camelCase(str) Converts string to camelCase.
shift(str, n) Shifts characters in string by n positions.
makeHashTag(str) Converts string to hashtags.
isEmpty(str) Checks if string is empty or contains only whitespace.
License
MIT