Avatar of SStroz
SStroz
Flag for United States of America

asked on 

Forumula Question to replace single quotes

Gurus,

I am using the following formula to replace one character for another character:

local numbervar i;
local stringvar char;
local stringvar str;
stringvar string := {Orders.Ship Via};


for i := 1 to length(string)
do
if string[i] = ' '
then str := str + 'a'
else if string[i] = 's'
then str := str + 'B'
else str := str + string[i];

str


It is working well except I need to replace:
'
for the letter
b

I get an error message that says:
"The matching ' for this string is missing
OK"


What am I missing?  What is the correct syntax to use to avoid the error message?

Thanks in advance,

Steve
Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon