translate searches
tablei for each character
in the receiving string. If the character is found, the corresponding character
in tableo is used in the result string. If
there are duplicates in tablei, the first
(leftmost) occurrence is used. If the character is
not found, the original character in the receiving string is used. The result
string is always of the same length as the receiving string.a-z
to uppercase
A-Z),
but if you include pad
the entire
string is translated to pad characters.
tablei defaults to
XRANGE("00"x,"FF"x), and
tableo defaults to the null string and
is padded with pad or truncated as necessary.
The default pad is a blank."abcdef"~translate --> "ABCDEF"
"abcdef"~translate(, , , 3, 2) --> "abCDef"
"abcdef"~translate("12", "ec") --> "ab2d1f"
"abcdef"~translate("12", "abcd", ".") --> "12..ef"
"APQRV"~translate(, "PR") --> "A Q V"
"APQRV"~translate(XRANGE("00"X, "Q")) --> "APQ "
"4123"~translate("abcd", "1234", , 2, 2) --> "4ab3"
"4123"~translate("abcd", "1234") --> "dabc"
translate method
to reorder the characters in a string. In the example, the last character
of any 4-character string specified as the first argument would be moved to
the beginning of the string.