From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, WEIRD_QUOTING autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cf72236526e50aab X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: newbie question: the " character inside a string Date: 2000/05/24 Message-ID: <8ggfud$75b$1@hobbes2.crc.com>#1/1 X-Deja-AN: 626686444 References: <8ggcnp$83r$1@inf2.informatik.uni-stuttgart.de> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@crc.com X-Trace: hobbes2.crc.com 959169293 7339 198.175.145.56 (24 May 2000 11:54:53 GMT) Organization: CRC: A wholly owned subsidiary of Thermo Electron X-MSMail-Priority: Normal NNTP-Posting-Date: 24 May 2000 11:54:53 GMT Newsgroups: comp.lang.ada Date: 2000-05-24T11:54:53+00:00 List-Id: Martin Tobisch wrote in message news:8ggcnp$83r$1@inf2.informatik.uni-stuttgart.de... > hello everbody, > > i have a simple question : > > what do i have to do if i want to include a " inside of a string? > for instance make the string: name="something"? > can i write is as normal "name="something"" an ADA will ignore > the inner "'s es as string delimiter and only look for the outest "'s es? > or do i have to quote the " inside of a string with a special character? > Here is the relevant section of the Ada Reference Manual: 2.6 String Literals 1 A string_literal is formed by a sequence of graphic characters (possibly none) enclosed between two quotation marks used as string brackets. They are used to represent operator_symbols (see 6.1), values of a string type (see 4.2), and array subaggregates (see 4.3.3). Syntax 2 string_literal ::= "{string_element}" 3 string_element ::= "" | non_quotation_mark_graphic_character 4 A string_element is either a pair of quotation marks (""), or a single graphic_character other than a quotation mark. Static Semantics 5 The sequence of characters of a string_literal is formed from the sequence of string_elements between the bracketing quotation marks, in the given order, with a string_element that is "" becoming a single quotation mark in the sequence of characters, and any other string_element being reproduced in the sequence. 6 A null string literal is a string_literal with no string_elements between the quotation marks. NOTES 7 5 An end of line cannot appear in a string_literal. Examples 8 Examples of string literals: 9 "Message of the day:" "" -- a null string literal " " "A" """" -- three string literals of length 1 "Characters such as $, %, and } are allowed in string literals" > thanks for any help > > Greetings MArtin Tobisch > > >