$string
Updated on Oct 29, 2025 4 minutes to readThe String Plugin provides a comprehensive set of utilities for string manipulation, formatting, and normalization — including case conversions, transliteration, and template compilation.
Methods
| Method | Description |
|---|---|
| camelize | Converts a string to CamelCase. |
| capitalize | Capitalizes the first letter and lowercases the rest. |
| compile | Compiles a template string by replacing placeholders. |
| kebabize | Converts a string to kebab-case. |
| slugify | Creates a URL-safe slug by transliterating and kebab-casing the text. |
| transliterate | Transliterates text into ASCII equivalents. |
| variablize | Converts a string into a camelCase variable name. |
Methods Details
camelize()
• Type
(value: string) => string
• Details
Expects a string as input.
Returns a CamelCased string with all delimiters removed and each word capitalized.
• Example
const result = E8App.$string.camelize("hello_world example");
// result = "HelloWorldExample"
capitalize()
• Type
(value: string) => string
• Details
Expects a string as input.
Returns a string with the first character capitalized and the rest lowercased.
• Example
const result = E8App.$string.capitalize("hELLO");
// result = "Hello"
compile()
• Type
(template: string, params: object) => string
• Details
Expects a template string containing placeholders in the form {{ key }} and a params object with replacement values.
Returns a string where all placeholders are replaced by corresponding values from params.
⚠️ Placeholders without matches remain unchanged.
• Example
const template = "Hello, {{ name }}! Today is {{ day }}.";
const result = E8App.$string.compile(template, { name: "Alice", day: "Wednesday" });
// result = "Hello, Alice! Today is Wednesday."
kebabize()
• Type
(value: string) => string
• Details
Expects a string as input.
Returns a kebab-cased string — all lowercase, with words separated by dashes.
⚠️ Non-alphanumeric characters are treated as word separators.
• Example
const result = E8App.$string.kebabize("Hello World_test");
// result = "hello-world-test"
slugify()
• Type
(value: string) => string
• Details
Expects a string as input.
Returns a URL-safe slug (ASCII-only, lowercase, dash-separated).
⚠️ Non-alphanumeric characters are treated as word separators.
• Example
const result = E8App.$string.slugify("Crème brûlée naïve façade");
// result = "creme-brulee-naive-facade"
transliterate()
• Type
(value: string) => string
• Details
Expects a string as input.
Returns a string with diacritics and non-Latin characters replaced by approximate ASCII equivalents.
• Example
const result = E8App.$string.transliterate("Česká republika, München, São Paulo");
// result = "Ceska republika, Munchen, Sao Paulo"
variablize()
• Type
(value: string) => string
• Details
Expects a string as input.
Returns a camelCase string, where the first word is lowercase and the following words are capitalized.
• Example
const result = E8App.$string.variablize("hello_world");
// result = "helloWorld"