string-utils-advanced
v1.1.0
Published
An advanced string manipulation utility package
Downloads
6
Maintainers
Readme
String Utils Advanced 🚀
A powerful string manipulation utility package for JavaScript.
📌 Installation
npm install string-utils-advanced
const StringUtils = require('../src/index');
// Testing various functions
console.log(StringUtils.toCamelCase("hello world")); // "helloWorld"
console.log(StringUtils.toPascalCase("hello world")); // "HelloWorld"
console.log(StringUtils.toSnakeCase("Hello World")); // "hello_world"
console.log(StringUtils.reverse("hello")); // "olleh"
console.log(StringUtils.isPalindrome("racecar")); // true
console.log(StringUtils.wordCount("hello world!")); // 2
console.log(StringUtils.uniqueWordCount("hello hello world")); // 2
console.log(StringUtils.mostFrequentWord("hello world hello")); // "hello"
console.log(StringUtils.removeDigits("hello123")); // "hello"
console.log(StringUtils.removeSpecialChars("hello@world!")); // "helloworld"
console.log(StringUtils.startsWith("hello world", "hello")); // true
console.log(StringUtils.endsWith("hello world", "world")); // true
console.log(StringUtils.contains("hello world", "lo w")); // true
console.log(StringUtils.isEmpty(" ")); // true
console.log(StringUtils.padString("hello", 10, "-")); // "hello-----"
