A lightweight TypeScript utility library for common string manipulation tasks, including case conversions, whitespace removal, numeric checks, and more.
- Convert strings to
camelCase
,snake_case
,kebab-case
, andTitle Case
- Check if a string contains
UPPERCASE
andlowercase
- Capitalize words or entire strings
- Reverse strings
- Remove whitespace
- Count occurrences of substrings
- Truncate strings with ellipses
npm install string-case-utils
| Function | Description |
| ------------------------- | ------------------------------------- |
| `camelCase()` | Converts a string to camelCase |
| `capitalize()` | Capitalizes the first letter |
| `countOccurrences()` | Counts substring occurrences |
| `isContainLowerCase()` | Checks if the string contains lowercase |
| `isContainUpperCase()` | Checks if the string contains uppercase |
| `isNumeric()` | Checks if the string is numeric |
| `kebabCase()` | Converts a string to kebab-case |
| `removeWhitespace()` | Removes all whitespace |
| `reverse()` | Reverses the string |
| `snakeCase()` | Converts a string to snake_case |
| `titleCase()` | Converts a string to Title Case |
| `truncate()` | Truncates a string to a given length |