JavaScript Editor js editor     Web development 



Main Page

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)

Parameters

cSearchedExpression


Specifies the expression in which CHRTRAN(В ) replaces characters.
cSearchExpression


Specifies the expression containing the characters CHRTRAN(В ) looks for in cSearchedExpression.
cReplacementExpression


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.

Return Value

Character

Remarks

CHRTRAN(В ) translates the character expression cSearchedExpression using the translation expressions cSearchExpression and cReplacementExpression and returns the resulting character string.

Example

В Copy Code
? CHRTRAN('ABCDEF', 'ACE', 'XYZ')  && Displays XBYDZF
? CHRTRAN('ABCD', 'ABC', 'YZ')  && Displays YZD
? CHRTRAN('ABCDEF', 'ACE', 'XYZQRST')  && Displays XBYDZF

See Also



JavaScript Editor js editor     Web development