CONVERT Statement

Replaces individual characters within a string.

Syntax

CONVERT oldCharList TO newCharList IN string

Syntax Elements

oldCharList is the list of characters to be changed.

newCharList is a list of replacement characters.

string is a variable containing the string to be processed.

Operation

The CONVERT statement is similar to the CONVERT function, but does not create a new string; it directly modifies the string.

See Also

CONVERT function, CHANGE function.

Example

X = "ABC123DEF456DKDKEIS"
Y = "C2DK"
Z = "Z9:"
CONVERT Y TO Z IN X

Changes the value of variable X (ABC123DEF456DKDKEIS) to ABZ193:EF456::EIS. Note that K is missing from the modified string because K did not have a replacement character in Z.

Go to top button