A collection of utility functions for string manipulation in JavaScript.
You can install the radiant-bloom-utils
library via npm:
npm install radiant-bloom-utils
const utils = require('radiant-bloom-utils');
console.log(utils.capitalizeString('hello')); // Output: 'Hello'
console.log(utils.reverseString('hello')); // Output: 'olleh'
console.log(utils.isPalindrome('radar')); // Output: true
console.log(utils.toCamelCase('hello world')); // Output: 'helloWorld'
console.log(utils.generateRandomString(8)); // Output: '2h9p5AqZ'
console.log(utils.trimAndLowercase(' Hello World ')); // Output: 'hello world'
-
capitalizeString(str)
: Capitalizes the first character of a string. -
reverseString(str)
: Reverses a string. -
isPalindrome(str)
: Checks if a string is a palindrome. -
toCamelCase(str)
: Converts a string to camelCase. -
generateRandomString(length)
: Generates a random string of a specified length. -
trimAndLowercase(str)
: Trims whitespace and converts a string to lowercase.
This project is licensed under the MIT License - see the LICENSE file for details.