Turns a string to lowercase.
Parameters: none
{{lowercase "MAKE THIS ALL LOWERCASE"}}
Renders to:
make this all lowercase
Capitalizes each word in a string.
Parameters: none
{{capitalizeEach "capitalize EACH word in this sentence"}}
Renders to:
Capitalize EACH Word In This Sentence
Centers a string using non-breaking spaces.
Parameters: spaces: int
- The number of spaces. (Required)
{{center "Bender should not be allowed on tv." 10}}
Renders to:
| Bender should not be allowed on tv. |
Same as hyphenate
, but replaces dots in string with hyphens.
Parameters: none
{{dashify "make.this.all.hyphenated"}}
Renders to:
make-this-all-hyphenated
Output a formatted phone number
Credit: Treehouse Blog
Data:
number: 4444444444
Template:
{{formatPhoneNumber number}}
Renders to:
(444) 444-4444
Replace spaces in string with hyphens.
Parameters: none
{{hyphenate "make this all hyphenated"}}
Result:
make-this-all-hyphenated
Capitalizes the first word in a string.
Parameters: none
{{capitalizeFirst "capitalize first word in this sentence"}}
Renders to:
Capitalize first word in this sentence
Evaluate string A, and count the occurrences of string B within string A
Default: undefined
Parameters:
String A
(required): The string to evaluateString B
(required): The string to look for and count in "string A"{{occurrences "evaluate this string" "i"}}
Result:
2
Reverses a string.
Parameters: none
{{reverse "bender should NOT be allowed on TV."}}
Renders to:
.VT no dewolla eb TON dluohs redneb
Capitalizes the first word of each sentence in a string and converts the rest of the sentence to lowercase.
Parameters: none
{{sentence "capitalize the FIRST word in each sentence. but make the OTHER words lowercase."}}
Renders to:
Capitalize the first word in each sentence. But make the other words lowercase.
Capitalizes all words within a string. Taken from the templating library Walrus by Jeremy Ruppel.
Parameters: none
{{titleize "capitalize EACH word in this sentence"}}
Renders to:
Capitalize Each Word In This Sentence.
Truncates a string given a specified length
, providing a custom string to denote an omission
.
Parameters:
int
- The number of characters to keep (Required).string
- A string to denote an omission (Optional).{{truncate "Bender should not be allowed on tv." 31 "..."}}
Renders to:
Bender should not be allowed...
Turns a string to uppercase. Opposite of {{lowercase}}
.
Parameters: none
{{uppercase "make this all uppercase"}}
Renders to:
MAKE THIS ALL UPPERCASE
See the template for this page →
Find an error? Let us know →