[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: extract middle of string
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/