Re: replacing quotes
"George J Belland" <[email protected]> Thu, 07 Aug 2003 16:18:32 -0500
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Organization | geodentech.com |
| Message-ID | <3F327BD8.21058.151375F@localhost> |
We have written a function that we pass all javascript strings, href strings, etc to
"clean" them up and replace all problem characters.
Why not try:
Result := StringReplace(Result, #39, '\#39', [rfReplaceAll]);
or
Result := StringReplace(Result, #39, '''', [rfReplaceAll]);
On 7 Aug 2003 at 21:03, Brigitte Spatz wrote:
> For a Javascript function that's called from a website my application
> produces I need to replace any apostrophes by \' but I can't seem to get
> this to work:
> if Pos('''', aString) > 0 then
> Result := QuotedStr(StringReplace(aString, '''', '\' + #39,
> [rfReplaceAll]))
> returns \'' - where does the second ' come from??? I've also tried with
> if Pos('''', aString) > 0 then
> Result := QuotedStr(StringReplace(aString, '''', '\''',
> [rfReplaceAll]))
> with the same result :-(
>
> Any ideas?
>
> TIA.
>
> Brigitte
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> CodeCoffer - new Delphi code protection Tool!
> http://www.delphicollection.com/public/CodeCoffer.htm
> ---------------------------------------------------------------
> Unsubscribe:[email protected]
> List owner:[email protected]
> ---------------------------------------------------------------
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
***************************************************************
You can enter a weekly drawing to win a dozen roses free at:
www.flowerniche.com/index.html#winroses
***************************************************************
Visit Our WebSite at
www.geodentech.com
*********************************************************
This email and files transmitted may contain privileged information.
Any unauthorized disclosure, use or dissemination, either whole or partial, is
prohibited.
If you receive this message in error please return it to the sender and delete all
copies.
Thank you
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->
CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
---------------------------------------------------------------
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/