To get started, simply go into your project folder and run:
npm i @ryanlsmith/string_lib
This will install the string library into your application. To get access to the extended
functionallity that is provided by this library, add this to your index.js
or whatever you're
using as your applications main point of entry:
require('@ryanlsmith/string_lib')
Capitalize the first letter of the current string.
"this".capitalize() -> "This"
Returns String The capitalized version of the current string.
Uppercase every character within the string.
"this".allCaps() -> "THIS"
Returns String The entire string all capitalized of the current string.
Uppercase every word within the string
"this word".capitalizeWords() -> "This Word"
Returns String with every first character in every word capitalized of the current string.
Uppercase every other odd character not including white space.
"this".oddCaps() -> "tHiS"
Returns String of every odd character capitalized of the current string.
Uppercase every even character not including white space.
"this".evenCaps() -> "ThIs"
Returns String of every even character capitalized of the current string.
Remove any extra whitespace throughout the string.
x
(optional, default''
)
" this word ".removeExtraWhiteSpace() -> "this word"
Returns String with all the extra white space removed.
Snake case the current string if it has spaces.
"snake this!".kabobCase() -> "snake_case!"
Returns String that is a snake cased version of the current string
Convert the current string to camel case if it has spaces.
"camel case these words!".camelCase() -> "camelCaseTheseWords"
Returns String that is a camel cased version of the current string