REPLACEBY2

REPLACEBY2 returns a nonvarying string formed by replacing some of the characters in x by a pair of characters.

Read syntax diagramSkip visual syntax diagram
>>-REPLACEBY2--(----,  -y--,--z--)---------------------------><

x
Character expression to be searched for possible replacement of its characters.
y
Character expression containing the replacement pair values..
z
Character expression containing the characters that are to be replaced.

REPLACEBY2 operates on each character of x as follows:

If a character in x is found in z, the character pair in y that corresponds to that in z is copied to the result; otherwise, the character in x is copied directly to the result. If z contains duplicates, the leftmost occurrence is used.

The string y must be twice as long as the string z.

As an example, REPLACEBY2( ’Rätsel’, ’aeoeuess’, ’äöüß’) returns the string ’Raetsel’.






Published: 23 December 2018