Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Reverses the characters of a string.

reverse(x:string) -> string

The reverse function returns a new string with the characters of x in reverse order.

This function operates on Unicode codepoints, not grapheme clusters. Hence, it will not correctly reverse grapheme clusters composed of multiple codepoints.

from {x: reverse("hello")}
{x: "olleh"}

Last updated: