Examples of $TRANSLATE()

Example:

    GTM> WRITE $TR("ABC","CB","1")
    A1
    GTM>
    

Example:

    GTM> WRITE $TR("A","AA","BC")
    B
    GTM>
    

This $TRANSLATE() example finds the first occurrence of "A" in the second expression, which holds the first character position, and substitutes the character in the first position of the third expression.

Example:

    GTM> WRITE $TR("BACKUP","AEIOU")
    BCKP
    GTM>
    

Because the $TRANSLATE() has only two parameters in this example, it finds the characters in the first expression that also exist in the second expression and deletes them from the result.