translate
Swap individual characters: each character in the second argument becomes the character at the same position in the third. Characters with no counterpart are removed.
Try an expression
In Formula, enter the expression and set Output type to VARCHAR.
Expression
translate('12345', '143', 'ax')Result
'a2x5'To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
translate(string, from, to)- string
- Text
- from
- Text
- to
- Text
Supported signatures (1)
translate(string: VARCHAR, from: VARCHAR, to: VARCHAR) → VARCHARThe result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
If the first argument is missing, the result is NULL.
Function metadata from DuckDB, used under the MIT license.