[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Stata Journal and piece of string variables
> -----Original Message-----
> From: email@example.com [mailto:owner-
> firstname.lastname@example.org] On Behalf Of TEWODAJ MOGUES
> Sent: Saturday, November 20, 2004 1:43 AM
> To: Stata _
> Subject: st: Stata Journal and piece of string variables
> Another question (I don't find lots of info on the search regarding
> string variables): Is there a way for me to refer to a piece of string
> var? Say there is a string var called -automob- with values redcar and
> bluecar. Suppose I want to do something like
> drop if automob == " * car"
> thus gettingn rid of rows where the values are redcar or bluecar
> CLearly this syntax doesn't work, but is there a way to do something in
> this spirit without too complicated splitting-up of variables?
drop if substr(automob, -3 ,3) == "car"
* For searches and help try: