| ![]() |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: extract middle of string
From
"jean ries" <[email protected]>
To
[email protected]
Subject
Re: st: extract middle of string
Date
Tue, 24 Oct 2006 16:47:01 +0200
This should do the job:
gen newx = substr(x,2,length(x)-3)
On 10/24/06, Ronnie Babigumira <[email protected]> wrote:
I have a string variable that looks like this
x
161011000AT
161011000CN
1610110012CN
I am interested in what lies between the first and the last two characters
I could have used
gen str10 = subst(x, 2, 8) but that would not work for the last observation. How can I simply drop the first character,
and last two charters in x
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |