Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: extract middle of string

From   Ronnie Babigumira <>
Subject   st: extract middle of string
Date   Tue, 24 Oct 2006 16:30:54 +0200

I have a string variable that looks like this


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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index