Greetings,
I looked through the list of string functions but couldn't find one
that fits the bill. Suppose I have a string variable X, and I would
like to generate a new numeric variable Y containing the number of
times a certain string appeared in X. For instance
X = "johnabc johncd"
If I'd like to find the number of times "john" shows up in X, I hope to obtain
Y = 2
Is there a function in Stata to do this?
Thank you very much for your help!
Mingfeng
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/