Delphi strings use single quotes, for example 'a valid string
'. How does one specify the '
character within a literal string? How would one refer to the null byte (Unicode code point U+0000
)?
相关问题
- how to split a list into a given number of sub-lis
- Is there a Delphi 5 component that can handle .png
- Is there a way to install Delphi 2010 on Windows 2
- Generate string from integer with arbitrary base i
- Is TWebBrowser dependant on IE version?
相关文章
- JSP String formatting Truncate
- Selecting only the first few characters in a strin
- EscapeDataString having differing behaviour betwee
- Python: print in two columns
- extending c++ string member functions
- Best way to implement MVVM bindings (View <-> V
- Google app engine datastore string encoding proble
- Windows EventLog: How fast are operations with it?
To add a single quote to a string, you include two
'
marks e.g.In the string above, you have the normal single quotation to start a string and then two for the single quote. Same goes for the end of the string.
You can also use
#
followed by a number for other escape character e.g.For a new line:
or just
Of course, using the platform-dependent constant for newline is better.
To answer the last part of the question, you can use
To add U+0000
This way you can add the other Unicode chars too. (Be sure to use a font that can display those characters.)
For
'
character put it twice. For example:'Don''t'
. Null byte type as #0.