Contents | Index | < Browse | Browse >
TRANSLATE(<string>,[<output table>], [<input table>],[<padchar>])
returns a string
Any character in <string> that also appears in the <input table> is
converted to the corresponding character in the <output table> or to the
<padchar> if there isn't a corresponding character in the <output table>.
If neither table is supplied, then the <string> is converted to upper
case, just as it would be by UPPER(<string>) .
The default pad character is a blank.
Examples:
say translate('abcdef', '123456', 'abcdef') >>> 123456
say translate('abcdef', '123456', 'defabc') >>> 456123
say translate('abcdef', '1234', 'defabc','*') >>> 4**123
say translate('UNNAMABLE', xrange('a','z'), xrange('A','Z'))
>>> unnamable
Also see
Next: TRIM() | Prev: SUBSTR() | Contents: String functions