String manipulation

Posted by Dominik Loewenstein on 02-Mar-2017 04:45

Is their a function to insert a char or a string into a given position of an other string ?

Posted by martinz on 02-Mar-2017 04:52

You may want to take a look at the SUBSTRING statement. It can insert and overwrite.

All Replies

Posted by martinz on 02-Mar-2017 04:52

You may want to take a look at the SUBSTRING statement. It can insert and overwrite.

Posted by Patrick Tingen on 02-Mar-2017 07:35

There is also the OVERLAY command. Depending on what you want to do, you can use either SUBSTRING or OVERLAY:


DEFINE VARIABLE cBase-1 AS CHARACTER NO-UNDO INIT 'Hello World'. DEFINE VARIABLE cBase-2 AS CHARACTER NO-UNDO INIT 'Hello World'. SUBSTRING(cBase-1,7,0) = 'great '. OVERLAY(cBase-1,7,0) = 'great '. MESSAGE cBase-1 SKIP cBase-2 VIEW-AS ALERT-BOX INFO BUTTONS OK.

This thread is closed