1.0.0 • Published 1 year ago
@ashisj/string-utils v1.0.0
String Utils
A simple TypeScript package for string manipulation.
Installation
npm install @ashisj/string-utilsUSage
import { capitalizeWords, reverseString, countWords } from '@ashisj/string-utils';
// Capitalize words
console.log(capitalizeWords('hello world')); // Output: "Hello World"
// Reverse string
console.log(reverseString('hello')); // Output: "olleh"
// Count words
console.log(countWords('hello world')); // Output: 2API
capitalizeWords(str: string): string
Capitalizes the first letter of each word in a string
reverseString(str: string): string
Reverses all characters in a string.
countWords(str: string): number
Counts the number of words in a string.
1.0.0
1 year ago