[SOLVED] Problem with replacement of a character
Posted: Sat May 02, 2020 10:58 am
Hi Livecoders,
probably this is a very simple one, but unfortunately not simple enough for me
. In a string, e. g. "/folder/subfolder", I am wanting to replace the second "/" with a "."
To achieve this I coded the following:
With the above code though, both "/" are turned into a "." and not only the second one. How come
?
probably this is a very simple one, but unfortunately not simple enough for me

To achieve this I coded the following:
Code: Select all
put "/folder/subfolder" into fld "fField"
if offset("/", fld "fField", 1) > 1 then
put offset("/", fld "fField", 1) +1 into charPosition
replace char charPosition of fld "fField" with "." in fld "fField"
end if
