3️⃣ HBHString
Purpose: Chainable string utilities for case conversion, trimming, formatting, encoding, and more.
Key Features:
| Category | Examples |
|---|---|
| Trimming / Whitespace | trim, ltrim, rtrim, collapse |
| Case Conversion | toUpper, toLower, capitalize, uncapitalize, title, swapCase, alternatingCase |
| Casing / Naming | toCamelCase, toPascalCase, toSnakeCase, toKebabCase, slugify |
| Reversing / Padding | reverse, padStart, padEnd, padBoth, mirror, center |
| Filtering / Stripping | removeVowels, removeConsonants, onlyAlpha, onlyNumeric, onlyAlphaNumeric, stripHTML, stripSymbols, stripNonAlpha, stripNonASCII, stripPunctuation |
| Encoding / Decoding | base64, unbase64, uriEncode, uriDecode |
| Quotes / Wrapping | quote, singleQuote, parens, brackets, braces, wrap, wrapWith, encloseDouble, encloseSingle |
| Number / Digit | extractDigits, removeDigits, hasNumbers, isNumeric, toNumber |
| Fun / Creative | shout, mockingSponge, emojiWrap, binary, hex |
| String Info / Checks | length, wordCount, lineCount, isUpper, isLower, isBlank, startsWithA, endsWithZ, isSlugSafe |
| Custom Suffix / Prefix | addPrefix, addSuffix, wrapSlug |
| Markdown / HTML | markdownBold, markdownItalic, htmlBold, htmlItalic |
Usage Example:
1HBHString.toUpper("hello"); 2// → "HELLO"4HBHString.toCamelCase("hello world"); 5// → "helloWorld"7HBHString.removeVowels("beautiful"); 8// → "btfl"10HBHString.slugify("Héllö Wörld!"); 11// → "hello-world"13HBHString.shout("hey"); 14// → "HEY!!!"16HBHString.binary("AB"); 17// → "1000001 1000010"
These libraries are fully chainable thanks to ProxyBuilder. Each method can be called directly, or combined in a pipeline:
1HBHString.toUpper.removeVowels("hello world");2// → "HLL WRLD"4DataConverter.strToArrayByComma.strToInt(["1","2","3"]);5// → [1, 2, 3]