[Thread Prev][Thread Next][Index]
Re: sub-string
On Wed, 22 Jan 2003, Arindam Chakraborty wrote:
> how to get a sub-string (or sub-word) from a symbol?
> Say I write:
> define symbol tt = `prec,return=tend` ! prec in the variable name
> say ($tt)
> !-> MESSAGE/CONTINUE 01-SEP-1998 00:00
> 01-SEP-1998 00:00
>
> Now I want only the first part of the result string, i.e., 01-SEP-1998
> I tried something like this:
> ppl set tt1 $element(1," ",($tt))
> which results in a blank string tt1
Hi Arindam,
You've almost got it... just pass ELEMENT the symbol *name* instead of the
associated string:
ppl set tt1 $element(1," ",tt)
Cheers,
Andrew
+--------------------------------------------------------+
| Dr. Andrew T. Wittenberg | GFDL/NOAA |
| atw@gfdl.noaa.gov | Princeton, NJ |
+--------------------------------------------------------+
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement