REPLACE : want to replace the string
I need to replace a word(GO) in a sentence with another word(GONE). these words are stores in the variables var1(6) & var2(6) used the keyword REPLACE for this But I am getting some unwanted blank spaces. I used CONDENE keyword then also one blank space remains. I should not get any unwanted blank space. Please help me.
Data : var1(6) type c.
Data : var2(6) type c.
Data : var3(15) type c.
Data : len type i.
var1 = 'GO'.
var2 = 'GONE'.
var3 = 'ABCDGOEFGH'
len = strlen(var1).
REPLACE var1LENGTH len WITH var2 INTO var3.
Then the new sentence is coming like
I used CONDENSE then again it is coming like.
I need the sentence like ABCDGONEEFGH