String Intrinsic Functions - TranslateCharacters Method

Translate the specified characters

Member of String Intrinsic Functions (PRIM_LIBI.ICommonStringIntrinsics)

Parameters

Name Type Data Type Description
Result *Result (Optional) String Resulting value after all values have been replaced
From *Input String Characters to convert
To *Input (Optional) String Replacement characters

Details

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.

Example

In this example, if #String contained "ABCCBA", the result would be "CBAABC""
#String2 := #String.TranslateCharacters( "ABC", "CBA"' )

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020