Sign in Join
Wiki copytemporary

'

English · Suomi

The typewriter’s single quote ' is used in Pascal to delimit string and character literals.

pascal
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:

pascal
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:

pascal
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


From the Free Pascal wiki, page "'", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.