Skip to content

translate

translate(string, from, to) → string · String

Translate characters in a string: each character in from is replaced by the corresponding character in to.

  • string (required): the source string

  • from (required): characters to replace

  • to (required): replacement characters (same length)

utlx
translate("hello", "elo", "ELO")         // "hELLO"
translate("2026-05-01", "-", "/")        // "2026/05/01"

Released under AGPL-3.0.