comp.lang.ada
 help / color / mirror / Atom feed
* Using Quotes in Quotes (if you see what I mean)
@ 2011-08-05  7:15 tonyg
  2011-08-05  9:14 ` Jacob Sparre Andersen
  2011-08-11 23:10 ` Shark8
  0 siblings, 2 replies; 3+ messages in thread
From: tonyg @ 2011-08-05  7:15 UTC (permalink / raw)




I'm trying to search for a string containing the string "day = "2""
within some xml using gnat ada. Unfortunately the "2" is causing a
problem in that ada thinks it is the end of the string before it gets
to the end. Can someone tell me how I need to represent this to search
successfully ?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using Quotes in Quotes (if you see what I mean)
  2011-08-05  7:15 Using Quotes in Quotes (if you see what I mean) tonyg
@ 2011-08-05  9:14 ` Jacob Sparre Andersen
  2011-08-11 23:10 ` Shark8
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Sparre Andersen @ 2011-08-05  9:14 UTC (permalink / raw)


tonyg <tonythegair@gmail.com> writes:

> I'm trying to search for a string containing the string "day = "2""
> within some xml using gnat ada. Unfortunately the "2" is causing a
> problem in that ada thinks it is the end of the string before it gets
> to the end. Can someone tell me how I need to represent this to search
> successfully ?

You look up how to write string literals in the LRM.  (It might be in
section 2.6.)

Greetings,

Jacob
-- 
The secret is to bang the rocks together.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using Quotes in Quotes (if you see what I mean)
  2011-08-05  7:15 Using Quotes in Quotes (if you see what I mean) tonyg
  2011-08-05  9:14 ` Jacob Sparre Andersen
@ 2011-08-11 23:10 ` Shark8
  1 sibling, 0 replies; 3+ messages in thread
From: Shark8 @ 2011-08-11 23:10 UTC (permalink / raw)


On Aug 5, 2:15 am, tonyg <tonytheg...@gmail.com> wrote:
> I'm trying to search for a string containing the string "day = "2""
> within some xml using gnat ada. Unfortunately the "2" is causing a
> problem in that ada thinks it is the end of the string before it gets
> to the end. Can someone tell me how I need to represent this to search
> successfully ?

Well, if you're using that string as a constant, or an initialzation,
the correct way is to double up the quotes OR use the & operator with
the character literal.

Examples:
 Search_String : String:= "day = ""2""";
OR
 Search_String : String:= "day = " & '"' & "2" & '"';



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-11 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-05  7:15 Using Quotes in Quotes (if you see what I mean) tonyg
2011-08-05  9:14 ` Jacob Sparre Andersen
2011-08-11 23:10 ` Shark8

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox