Skip to content

Nyapal/string_library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String Library

npm npm collaborators

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

About

FEW 2.1 ~ Assignment 1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published