streng
v1.0.0
Published
Some helpful utility functions for handling strings & object keys
Downloads
2
Maintainers
Readme
streng
Some helpful utility functions for handling strings & object keys
Methods
Note: All methods force stringiness on the value passed as str
.
toSentenceCase(str, index)
: Capitalize the first letter of the first word.toUpperCase(str)
: Convert to all capitalstoLowerCase(str)
: Convert to all lowercasetoTitleCase(str)
: Capitalize the first letter of each wordtoSnakeCase(str)
: Replaces spaces with "_"snakeToCamel(str)
: Converts from snakecase to camelcasecamelToSnake(str)
: Converts from camelcase to snakecasesnakeObjectToCamelObject(obj)
: Converts object keys from snakecase to camelcasecamelObjectToSnakeObject(obj)
: Converts object keys from camelcase to snakecaseshortenWithCenterEllipsis(str, length)
: splits any string longer than the provided length with an ellipsistoListFromArray(arr)
: returns a string version of an arraysplitTimeString(str)
: provides the hours and minutes in a time string