REPLACE - FROM - WITH - IN

Introduced in LDPL 3.0.5 - Creative Carnotaurus

The REPLACE statement finds and replaces every occurrence of some TEXT in a TEXT variable or value some other TEXT. The result is then stored in a TEXT variable.

Syntax:

REPLACE <TEXT-VAR or TEXT> FROM <TEXT-VAR or TEXT> WITH <TEXT-VAR or TEXT> IN <TEXT-VAR>

Example:

REPLACE "COBOL" FROM "COBOL is great!" WITH "LDPL" IN sentiment
DISPLAY sentiment crlf

Outputs:

LDPL is great!