reverse
Reverses a string by rune, so multi-byte characters stay intact.
A cluster built from several code points (a combining sequence, or an emoji) is reversed code point by code point, which can reorder it.
InputArgumentsReturns
Sourcestringno argumentsstringBehaviors
- Coerces scalars to text
- A scalar value such as a number or a boolean is converted to its text form before matching, so
42is accepted as"42".
BasicSource
Reverses the value by rune, so multi-byte characters stay intact.
Given
{"word": "café"}Template
{{ word | reverse }}Result
éfacAsciiSource
Reverses a plain ASCII string character by character.
Given
{"word": "abc"}Template
{{ word | reverse }}Result
cbaNumberSource
Reverses a number by taking its string form first.
Given
{"n": 123}Template
{{ n | reverse }}Result
321