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.

InputArgumentsReturnsstringno argumentsstring
Source

Behaviors

Coerces scalars to text
A scalar value such as a number or a boolean is converted to its text form before matching, so 42 is accepted as "42".
BasicSource

Reverses the value by rune, so multi-byte characters stay intact.

Given

{"word": "café"}

Template

{{ word | reverse }}

Result

éfac
AsciiSource

Reverses a plain ASCII string character by character.

Given

{"word": "abc"}

Template

{{ word | reverse }}

Result

cba
NumberSource

Reverses a number by taking its string form first.

Given

{"n": 123}

Template

{{ n | reverse }}

Result

321