string-case-utils
v1.0.4
Published
Useful string utility functions like camelCase, truncate, reverse, etc.
Downloads
8
Maintainers
Readme
STRING-CASE-UTILS
A lightweight TypeScript utility library for common string manipulation tasks, including case conversions, whitespace removal, numeric checks, and more.
✨ Features
- Convert strings to
camelCase,snake_case,kebab-case, andTitle Case - Check if a string contains
UPPERCASEandlowercase - Capitalize words or entire strings
- Reverse strings
- Remove whitespace
- Count occurrences of substrings
- Truncate strings with ellipses
📦 Installation
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 |