![]() |
Apostroph im String escapen?
Ich müsste 'n Apostroph innen String schreiben. Delphi nimmt allerdings das Apostroph als Ende vom String an (was wir ja alle kennen).
Frage: wie escape ich das Apostroph, sodass es mir am Ende im String landet? |
Re: Apostroph im String escapen?
QuotedStr()
|
Re: Apostroph im String escapen?
Einfach verdoppeln.
|
Re: Apostroph im String escapen?
Delphi-Quellcode:
s:='Hier sind zwei ''Apostrophe'' im String';
|
Re: Apostroph im String escapen?
Delphi-Quellcode:
Gruß
CHR($27)
oder so wie meine verposter schrieben ;) |
Re: Apostroph im String escapen?
Das CHR bringt's, danke!
|
Re: Apostroph im String escapen?
:gruebel:
Also: 'Das is''n Text' --> Das is'n Text. Definitiv, da wird nix von halb zu ganz gemacht, was auch immer damit gemeint ist. |
Re: Apostroph im String escapen?
Noch ne Variante:
Delphi-Quellcode:
'Das is'#39'n Text'
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:59 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz