string-utils-kunal
v1.0.1
Published
this is a utility library that can make different types of string operation easier :D
Downloads
9
Maintainers
Readme
this npm package will provide you differnt methods to perform on an string which can make your experience on working with strings lot more easier.
@for installation #bash npm i string-utils-kunal
the method this package provide are -
@Case Conversion: # note : (please use[ - , _ ] where you want camel or pascal case while using camelCase,pascalCase for correct result)
=>toCamelCase(str): Converts a string to camelCase. =>toPascalCase(str): Converts a string to PascalCase. =>toSnakeCase(str): Converts a string to snake_case. =>toKebabCase(str): Converts a string to kebab-case.
@Trimming: =>trimStart(str): Trims whitespace from the start of a string. =>trimEnd(str): Trims whitespace from the end of a string. =>trim(str): Trims whitespace from both ends of a string.
@Padding: =>padStart(str, length, char): Pads the start of a string with a specified character until it reaches a given length. =>padEnd(str, length, char): Pads the end of a string with a specified character until it reaches a given length.
@Case Checking: =>isUpperCase(str): Checks if a string is in uppercase. =>isLowerCase(str): Checks if a string is in lowercase.
@Miscellaneous: =>reverse(str): Reverses a string. =>includes(str, searchStr): Checks if a string includes a given substring. =>truncate(str, length): Truncates a string to a specified length and adds ellipses (...) at the end if necessary.