10 6 59 TranslateCharacters

LANSA Technical

10.6.59 TranslateCharacters

TranslateCharacters is used to substitute characters in the subject string with characters in the 'To' string, using characters in the 'From' string as a key.  Whenever a character in the subject string matches a character in the 'From' string it will be replaced with the equivalent character in the 'To' string.

Input Parameters

From - a string containing the characters to search for in the subject string

To - a string containing the characters to replace in the subject string

Examples

The following assume that #String contains 'QWERTY':

* #String2 will be set to 'YTREWQ'
#String2 := #String.TranslateCharacters( 'QWERTY', 'YTREWQ' )
 

* #String2 will be set to 'qWeRtY'

#String2 := #String.TranslateCharacters( 'QET', 'qet' )
 

Ý 10.6 Alphanumeric/String Intrinsic Functions