i use a code to get the HTML from a page and save it's strings
but these strings sometimes come with '
as the '
character
im trying to replace it with the actual ' character and it doesn't seem to work i've tried this lines to find the string but no results
StringReplace(myString, ''', char(39), [rfReplaceAll]);
StringReplace(myString, char(39), '*', [rfReplaceAll]);
aPos := Pos(myString, char(39));
aPos := Pos(myString, ''');
aPos := Pos(myString, '&');
aPos := Pos(myString, '#');
aPos := Pos(myString, '039');
Apos is never > 0
if aPos > 0 then
begin
// replace the string
end;
StringReplace
does not work in-place. You must assign the result of the function to a(nother) string:Try that, and you'll see that
myOtherString
contains the proper format. Of course you can also do:EDIT
IMO, the function
Pos
is easier to remember as:So if you swap your parameters, it should work.