Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.
CHRTRAN(cSearchedExpression, cSearchExpression, cReplacementExpression)
- Specifies the expression in which CHRTRAN(В ) replaces characters.
- Specifies the expression containing the characters CHRTRAN(В ) looks for in cSearchedExpression.
- Specifies the expression containing the replacement characters. If a character in cSearchExpression is found in cSearchedExpression, the character in cSearchedExpression is replaced by a character from cReplacementExpression that's in the same position in cReplacementExpression as the respective character in cSearchExpression. If cReplacementExpression has fewer characters than cSearchExpression, the additional characters in cSearchExpression are deleted from cSearchedExpression. If cReplacementExpression has more characters than cSearchExpression, the additional characters in cReplacementExpression are ignored.
CHRTRAN(В ) translates the character expression cSearchedExpression using the translation expressions cSearchExpression and cReplacementExpression and returns the resulting character string.
? CHRTRAN('ABCDEF', 'ACE', 'XYZ') && Displays XBYDZF ? CHRTRAN('ABCD', 'ABC', 'YZ') && Displays YZD ? CHRTRAN('ABCDEF', 'ACE', 'XYZQRST') && Displays XBYDZF