![]() |
From | "Nick Cox" <n.j.cox@durham.ac.uk> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: Extract Year from String |
Date | Tue, 13 Oct 2009 19:08:51 +0100 |
Use the -substr()- function. More generally, check out string functions. Nick n.j.cox@durham.ac.uk jasonm@ucla.edu I need to extract year from a string variable (str24 %24s). How can I extract, for example, 1998 from this observation: Dec/17/1998 11:30:00 PM * * 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–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |