Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Community interest groups have now moved from Yammer to Microsoft Viva Engage. To join a Viva Engage community and take part in the latest discussions, fill out the Request access to Finance and Operations Viva Engage Community form and choose the community you want to join.
The TRANSLATE function returns a String value that contains the result of the character replacement of specified text in characters of another provided set.
Syntax
TRANSLATE (text , pattern, replacement)
Arguments
text: String
The valid path of a data source of the String type.
pattern: String
The text that must be replaced.
replacement: String
The text to use as a replacement.
Return values
String
The resulting text value.
Usage notes
The TRANSLATE function replaces one character at a time. The function replaces the first character of the text argument with the first character of the pattern argument and then the second character and follows the same flow until finished. When a character from the text and pattern arguments match, it is replaced by a character from the replacement argument that is located in the same position as the character from the pattern argument. If a character appears multiple times in the pattern argument, the replacement argument mapping that corresponds to the first occurrence of this character is used.
Example 1
TRANSLATE ("abcdef", "cd", "GH") replaces the "c" character of the specified “abcdef” text with the "G" character of the replacement text due to the following:
- The "c" character is presented in the
patterntext in the first position. - The first position of the
replacementtext contains the "G" character.
Example 2
TRANSLATE ("abcdef", "ccd", "GH") returns "abGdef".
Example 3
TRANSLATE ("abccba", "abc", "123") returns "123321".