
Enter a search term above to see results...
Enter a search term above to see results...
String helpers provide utilities for manipulating and formatting strings in templates.
Converts a value to JSON string.
{stringify objectToStringify}
Name | Type | Description |
---|---|---|
a | any | The value to stringify |
string
- JSON string representation of the input.
<pre>{stringify user}</pre>
Concatenates all arguments.
{concat firstName ' ' lastName}
Name | Type | Description |
---|---|---|
args | …any | Values to concatenate |
string
- Concatenated string of all arguments.
<h1>Welcome, {concat user.firstName ' ' user.lastName}!</h1>
Capitalizes the first letter of text.
{capitalize textToCapitalize}
Name | Type | Description |
---|---|---|
text | string | The text to capitalize |
string
- The input text with the first letter capitalized.
<p>{capitalize pageTitle}</p>
Converts text to title case.
{titleCase textToTitleCase}
Name | Type | Description |
---|---|---|
text | string | The text to convert |
string
- The input text converted to title case.
<h2>{titleCase article.title}</h2>
Creates a URL-friendly token from a string.
{tokenize stringToTokenize}
Name | Type | Description |
---|---|---|
string | string | The string to tokenize |
string
- A URL-friendly token (e.g., “hello-world”).
<div id="{tokenize sectionTitle}"> <h3>{sectionTitle}</h3></div>
Truncates text to a specified length with optional suffix.
{truncate textToTruncate maxLength}{truncate textToTruncate maxLength {suffix: '…', wordBoundary: false}}
Name | Type | Default | Description |
---|---|---|---|
text | string | The text to truncate | |
length | number | Maximum length of the output | |
options | object | Truncation options |
Name | Type | Default | Description |
---|---|---|---|
suffix | string | ’…’ | Text to append when truncated |
wordBoundary | boolean | true | Whether to truncate at word boundaries |
string
- The truncated text with suffix if needed.
<p class="summary">{truncate article.content 150}</p><p class="excerpt">{truncate description 50 {suffix: '…'}}</p>
Escapes HTML special characters in a string.
{escapeHTML stringToEscape}
Name | Type | Description |
---|---|---|
string | string | The string to escape |
string
- The input string with HTML special characters escaped.
<div title="{escapeHTML userInput}"> {userInput}</div>
<h3>User Bio</h3><p> {#html escapeHTML bioHTML}</p>
Converts text to lowercase.
{lowercase textToConvert}
Name | Type | Description |
---|---|---|
text | string | The text to convert to lowercase |
string
- The text converted to lowercase.
<p>Email: {lowercase userEmail}</p><p>Username: {lowercase displayName}</p>
Converts text to uppercase.
{uppercase textToConvert}
Name | Type | Description |
---|---|---|
text | string | The text to convert to uppercase |
string
- The text converted to uppercase.
<p>Code: {uppercase productCode}</p><p>Status: {uppercase currentStatus}</p>