@mfx2/string-library-util
v1.0.2
Published
String utility library
Downloads
5
Readme
String Library
This is a JavaScript library that provides various string manipulation functions.
capitalize(str)
Makes the first character of a given string uppercase.
allCaps(str)
Makes all characters in the string uppercase.
capitalizeWords(str)
Makes the first character of each word in the string uppercase.
removeExtraSpaces(str)
Removes all spaces from the beginning and end of the 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.
kebobCase(str)
Removes extra spaces and replaces spaces with a hyphen "-" and makes all characters lowercase.
snakeCase(str)
Removes extra spaces and replaces spaces with an underscore "_" and makes all characters lowercase.
camelCase(str)
Lowercases the first character of the first word. Then uppercases the first character of all other words, and removes all spaces.
shift(str)
Takes the first character of a string and moves it to the end of the string.
makeHashTag(str)
Converts the string to an array of words beginning with a hashtag. Only returns the three longest words.
isEmpty(str)
Returns true if the given string is empty or contains only whitespace.