Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Compound double quote


From   tashi lama <[email protected]>
To   <[email protected]>
Subject   RE: st: Compound double quote
Date   Mon, 20 Aug 2012 19:15:13 +0000

Thanks a lot. 
----------------------------------------
> Date: Mon, 20 Aug 2012 17:12:25 +0100
> Subject: Re: st: Compound double quote
> From: [email protected]
> To: [email protected]
>
> I should add to that.
>
> A major point here is that what -display- shows is always stripped of
> quotation marks when those marks are used as delimiters, or more
> precisely when it looks to Stata as if they are.
>
> Forgetting about local macros, consider
>
> . di "frog"
> frog
>
> . di `"toad"'
> toad
>
> The delimiters aren't shown. Their job was to be delimiters: to show
> where literal strings begin and end, and their fate is to be ignored
> on display (more precisely -display-).
>
> As a related example, consider
>
> . local 1 `""frog""'
>
> . di `"`1'"'
> "frog"
>
> . di `1'
> frog
>
> Here the c.d.q. were used to insist that the " " were part of the
> macro. You still have to be extra-careful to get them displayed.
>
> Nick
>
> On Mon, Aug 20, 2012 at 4:56 PM, Nick Cox <[email protected]> wrote:
> > The first token of
> >
> > "AMC Concord", 2, 4
> >
> > even when parsing on commas is reported as
> >
> > AMC Concord
> >
> > as Stata's tendency is to strip " " as delimiters at each level of
> > parsing. To insist that " " are included as part of the token, I think
> > you need to start with
> >
> > local line `" `""AMC Concord""', 2, 4 "'
> > tokenize `"`line'"', parse(",")
> > di `"`1'"'
> >
> > Appropriate thanks would to be stop misspelling "Thanks" !
> >
> > Nick
> >
> > On Mon, Aug 20, 2012 at 4:34 PM, tashi lama <[email protected]> wrote:
> >>
> >> Could someone help me with the following
> >>
> >> local line "AMC Concord", 2, 4
> >> tokenize `"`line'"', parse(",")
> >> di `"`1'"'
> >> AMC Concord (I was hoping to get "AMC Concord" with double quotation). Any idea?
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/ 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index