@emzra/string-library

1.0.0 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i @emzra/string-library

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

16 kB

Total Files

9

Last publish

Collaborators

  • emzra