Documentation Index
Fetch the complete documentation index at: https://docs.fileloom.io/llms.txt
Use this file to discover all available pages before exploring further.
String manipulation helpers modify and transform text content.
trim
Removes whitespace from both ends of a string.
Output: hello world
truncate
Shortens text to a specified length with optional suffix.
{{truncate text 50}}
{{truncate text 50 "..."}}
{{truncate text 50 " [more]"}}
| Argument | Type | Default | Description |
|---|
text | string | required | Text to truncate |
length | number | 100 | Maximum length |
suffix | string | ”…” | Suffix when truncated |
Examples:
{{truncate "This is a very long description that needs to be shortened" 30}}
Output: This is a very long descriptio...
{{truncate description 100 " [read more]"}}
substring
Extracts a portion of a string.
| Argument | Type | Default | Description |
|---|
text | string | required | Source text |
start | number | 0 | Start index |
end | number | end of string | End index |
Examples:
{{substring "Hello World" 0 5}}
Output: Hello
{{substring "Hello World" 6}}
Output: World
replace
Replaces all occurrences of a string with another.
{{replace text "find" "replace"}}
| Argument | Type | Description |
|---|
text | string | Source text |
find | string | String to find |
replace | string | Replacement string |
Examples:
{{replace "Hello World" "World" "Universe"}}
Output: Hello Universe
{{replace phoneNumber "-" ""}}
<!-- Input: "555-123-4567" → Output: "5551234567" -->
repeat
Repeats a string a specified number of times.
| Argument | Type | Default | Description |
|---|
text | string | required | Text to repeat |
times | number | 1 | Number of repetitions |
Examples:
Output: *****
<div class="separator">{{repeat "─" 40}}</div>
padStart
Pads the beginning of a string to reach a specified length.
| Argument | Type | Default | Description |
|---|
text | string | required | Text to pad |
length | number | 2 | Target length |
padString | string | ” “ | Padding character |
Examples:
Output: 000042
Invoice #{{padStart invoiceNumber 8 "0"}}
<!-- Input: 123 → Output: Invoice #00000123 -->
padEnd
Pads the end of a string to reach a specified length.
| Argument | Type | Default | Description |
|---|
text | string | required | Text to pad |
length | number | 2 | Target length |
padString | string | ” “ | Padding character |
Examples:
{{padEnd "Price" 20 "."}}${{price}}
Output: Price...............$99.00
reverse
Reverses the characters in a string.
Output: olleh
removeSpaces
Removes all whitespace from a string.
{{removeSpaces "hello world example"}}
Output: helloworldexample
Use cases:
- Phone numbers
- Credit card numbers (for processing)
- Compact identifiers
{{removeSpaces "1234 5678 9012 3456"}}
<!-- Output: 1234567890123456 -->
Practical Examples
INV-{{padStart year 4 "0"}}-{{padStart month 2 "0"}}-{{padStart number 6 "0"}}
<!-- Output: INV-2024-12-000042 -->
Description Preview
<p class="preview">{{truncate description 150}}</p>
<a href="/full">Read more</a>
Clean Phone Display
{{! Format: (555) 123-4567 from 5551234567 }}
({{substring phone 0 3}}) {{substring phone 3 6}}-{{substring phone 6 10}}
Text Separator
<pre>
{{repeat "=" 60}}
{{padEnd "Item" 30}}{{padStart "Amount" 25}}
{{repeat "=" 60}}
</pre>