Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.86 KB

README.md

File metadata and controls

47 lines (38 loc) · 1.86 KB

Kevin String

npm GitHub repo size Build Status Coverage Status

Getting Started

Run the following command in your project folder:

npm install @ericanaglik/kevin-string --save

Then add this to your index.js file

require('@ericanaglik/src/kevin-string')

Capitalization

capitalize()
This method capitalizes the first letter of an entire string
'hello world!'.capitalize() → "Hello world!"

allCaps()
This method capitalizes ALL letters in a string
'hello world!'.allCaps() → "HELLO WORLD!"

capitalizeWords()
This method capitalizes the first letter of every word in a string
'hello world!'.capitalizeWords() → "Hello World!"

Special Casing

kabobCase()
This method transforms a string into lower case and separates words with hyphens
'Hello World'.kabobCase() → "hello-world"

snakeCase()
This method transforms a string into lower case and separates words with an underscore
'Hello World'.snakeCase() → "hello_world"

camelCase()
This method removes spaces from a string and capitalizes the first letter of each word following the first word
'Hello World'.camelCase() → "helloWorld"

Spacing

removeExtraSpaces()
This method removes excess spaces around words (leaves single space)
' Hello World '.removeAllSpaces() → "Hello World"