string-utils-pro
v1.0.3
Published
An advanced string manipulation utility package
Maintainers
Readme
string-utils-pro 🚀
A powerful string manipulation utility package for JavaScript.
📌 Installation
npm install string-utils-pro
const StringUtils = require('string-utils-pro');
// Testing all the functions
console.log("toCamelCase :", StringUtils.toCamelCase("hello world")); // "helloWorld"
console.log("toPascalCase :", StringUtils.toPascalCase("hello world")); // "HelloWorld"
console.log("toSnakeCase :", StringUtils.toSnakeCase("Hello World")); // "hello_world"
console.log("reverse :", StringUtils.reverse("hello")); // "olleh"
console.log("isPalindrome :", StringUtils.isPalindrome("racecar")); // true
console.log("wordCount :", StringUtils.wordCount("hello world!")); // 2
console.log("uniqueWordCount :", StringUtils.uniqueWordCount("hello hello world")); // 2
console.log("mostFrequentWord :", StringUtils.mostFrequentWord("hello world hello")); // "hello"
console.log("removeDigits :", StringUtils.removeDigits("hello123")); // "hello"
console.log("removeSpecialChars :", StringUtils.removeSpecialChars("hello@world!")); // "helloworld"
console.log("startsWith :", StringUtils.startsWith("hello world", "hello")); // true
console.log("endsWith :", StringUtils.endsWith("hello world", "world")); // true
console.log("contains :", StringUtils.contains("hello world", "lo w")); // true
console.log("isEmpty :", StringUtils.isEmpty(" ")); // true
console.log("padString :", StringUtils.padString("hello", 10, "-")); // "hello-----"
console.log("toAcronym :", StringUtils.toAcronym("Machine Learning Model")); // "MLM"
console.log("extractEmails :", StringUtils.extractEmails("Email me at [email protected]")); // ["[email protected]"]
console.log("convertTimeFormat :", StringUtils.convertTimeFormat("03:45 PM")); // "15:45"
console.log("numberToText :", StringUtils.numberToText(123)); // "One Hundred Twenty-Three"
