Star
Star

Reputation: 2299

Dropping observations in Stata based on length?

I have a string variable in Stata called Cod. I want to drop the observations such that Cod has less than 16 characters. Any suggestion?

Upvotes: 1

Views: 4980

Answers (1)

Nick Cox
Nick Cox

Reputation: 37358

You should look at help string functions to learn basic syntax here.

drop if length(Cod) < 16

may be what you seek.

Upvotes: 2

Related Questions