Question ID : 276
Created on 2016-06-29 at 8:23 AM
Author : Veryant Support [support@veryant.com]
Online URL : http://support.veryant.com/support/phpkb/question.php?ID=276
Usually to replace a text in a string you use the "inspect replacing" statement. But with this kind of approach the original text and the new text must have the same length.
To avoid this problem you can use the "C$REPLACE_ALL" routine.
This routine uses the regular expression syntax in both the search string and the replace string.
Here's the syntax for C$REPLACE_ALL:
call "C$REPLACE_ALL" using wrk-str search-string replace-string crep-right-trimmed w-error giving wstatusWhere:
move "Today is a rainy day" to wrk-str call "C$REPLACE-ALL" using wrk-str "rainy" "very sunny" crep-right-trimmed w-error giving wstatus