1.0.1 • Published 3 years ago

@nyapals/string_library v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

String Library

Capitalize

str.capitalize() makes the first character of a given string uppercase.

All Caps

str.allCaps() makes all characters uppercase.

Capitalize Words

str.capitalizeWords() makes the first character of each word uppercase.

Remove Extra Spaces

str.removeExtraSpaces() removes all spaces from the beginning and end of a string along with any extra spaces in the middle. If more than one space appears in the middle of a string it is replaced by a single space.

Kebob Case

str.kebobCase() makes all characters lowercase, removes extra spaces and replaces spaces with the hyphen "-".

Snake Case

str.snakeCase() makes all characters lowercase, removes extra space and replaces spaces with an underscore "_".

Camel Case

str.camelCase() lowercases the first character of the first word. Then uppercases the first character of all other words, and removes all spaces.

Shift

str.shift() takes the first character of a string and moves it to the end of the string. Optional second parameter that sets the number of characters to shift.

Hash Tag

str.makeHashTag() converts the given string to a hash tag. If the given string has more than three words the three longest will make the hash tag.

Empty

str.isEmpty() returns true if the given string is empty or contains only whitespace.

FEW 2.1 ~ Assignment 1