Difference between revisions of "'"
(complete rewrite) |
|||
Line 1: | Line 1: | ||
{{'}} | {{'}} | ||
− | The typewriter’s single quote <syntaxhighlight lang="pascal" | + | The typewriter’s single quote <syntaxhighlight lang="pascal" inline>'</syntaxhighlight> is used in [[Pascal]] to delimit [[Character and string types|string and character literals]]. |
<syntaxhighlight lang="pascal" highlight="3"> | <syntaxhighlight lang="pascal" highlight="3"> | ||
Line 12: | Line 12: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | In order to insert a <syntaxhighlight lang="pascal" | + | In order to insert a <syntaxhighlight lang="pascal" inline>'</syntaxhighlight> into a character or string literal, two <syntaxhighlight lang="pascal" inline>'</syntaxhighlight> are written back-to-back: |
<syntaxhighlight lang="pascal" highlight="3"> | <syntaxhighlight lang="pascal" highlight="3"> | ||
program singleQuoteDemo(input, output, stdErr); | program singleQuoteDemo(input, output, stdErr); | ||
Line 32: | Line 32: | ||
See [https://bugs.freepascal.org/view.php?id=35827 bug #35827] for a (as of 2019‑08‑24) proposed feature. | See [https://bugs.freepascal.org/view.php?id=35827 bug #35827] for a (as of 2019‑08‑24) proposed feature. | ||
− | In [[GNU Pascal|GPC]] <syntaxhighlight lang="pascal" | + | In [[GNU Pascal|GPC]] <syntaxhighlight lang="pascal" inline>"</syntaxhighlight> are used as string delimiters, too. |
Such strings can contain backslash-escaped control characters. | Such strings can contain backslash-escaped control characters. | ||
− | In [[ASCII]] the character <syntaxhighlight lang="pascal" | + | In [[ASCII]] the character <syntaxhighlight lang="pascal" inline>'</syntaxhighlight> has the ordinal value <syntaxhighlight lang="pascal" inline>39</syntaxhighlight> (or [[Hexadecimal|hexadecimal]] <syntaxhighlight lang="pascal" inline>27</syntaxhighlight>). |
− | The <syntaxhighlight lang="pascal" | + | The <syntaxhighlight lang="pascal" inline>’</syntaxhighlight> (<syntaxhighlight lang="text" inline>U+2019</syntaxhighlight> “right single quotation mark”) is the typographically correct character marking the possessive case in English (e. g. “the dog’s ball”). |
== see also == | == see also == |
Latest revision as of 17:15, 6 August 2022
│
English (en) │
suomi (fi) │
The typewriter’s single quote '
is used in Pascal to delimit string and character literals.
program helloWorld(input, output, stdErr);
resourcestring
greeting = 'Hello world!';
begin
writeLn(greeting);
end.
In order to insert a '
into a character or string literal, two '
are written back-to-back:
program singleQuoteDemo(input, output, stdErr);
begin
writeLn('writeLn(''…'');');
end.
One may inject numeric character entities into a string, by placing them directly adjacent to one another:
program bellDemo(input, output, stdErr);
begin
writeLn('🕭'#7);
end.
other remarks
The only forbidden character in a string or character literal is a carriage return. See bug #35827 for a (as of 2019‑08‑24) proposed feature.
In GPC "
are used as string delimiters, too.
Such strings can contain backslash-escaped control characters.
In ASCII the character '
has the ordinal value 39
(or hexadecimal 27
).
The ’
(U+2019
“right single quotation mark”) is the typographically correct character marking the possessive case in English (e. g. “the dog’s ball”).
see also
single characters |
|
character pairs |
|