Allows you to convert individual characters in a
string from one value to another. In many languages, this function
is powerful enough to convert characters from one case to another.
([2.0] For case conversions, XQuery 1.0 and
XPath 2.0 provide the more powerful
$mapString as string,
$transString as string
$mapString as xs:string,
$transString as xs:string
Three strings. The first is the original, untranslated string, and the second and third strings define the characters to be converted.
The original string, translated as follows:
If a character in the original string appears in the second argument string (the mapping string), it is replaced with the corresponding character in the third argument string (the translation string).
In other words,
translate('CAR', 'ABCDE', 'EXHQF')
HER. Going through
the characters of the first string in order,
C is the third character in the
mapping string, so it is replaced with
H, the third character in the
translation string. The next character of the first string,
A, is the first character
in the mapping string, so it is replaced with
E, the first character in the
translation string. Finally, the last character of the first
R, doesn’t appear
in the second string, so it is not modified at all.
If a character in the original string appears in the second argument string and there is no corresponding ...