string-tools-ts
v1.0.0
Published
A simple JavaScript utility library for string operations — capitalize, reverse, and isPalindrome.
Maintainers
Readme
string-tools
string-tools
🛠️ A simple JavaScript utility library for string operations —
capitalize,reverse, andisPalindrome.
📦 Installation
npm install string-toolsor with Yarn:
yarn add string-tools🚀 Usage
const { capitalize, reverse, isPalindrome } = require("string-tools");
// Capitalize first letter
console.log(capitalize("hello")); // "Hello"
// Reverse a string
console.log(reverse("world")); // "dlrow"
// Check palindrome
console.log(isPalindrome("madam")); // true
console.log(isPalindrome("hello")); // false📖 API Reference
capitalize(str: string): string
Returns the input string with the first letter capitalized.
reverse(str: string): string
Returns the input string reversed.
isPalindrome(str: string): boolean
Checks if the string is a palindrome (case-insensitive, ignores non-alphanumeric chars).
🌐 Links
- NPM: string-tools
- GitHub: Repository
📄 License
© [Yubraj Dhungana](https://github.com/yubiStona)
