-- as Martin did point out separately.
Nick
[email protected]
Nick Cox
So, the test is
count if substr(var1, -2, 2) == ":2"
Martin Weiss
Tunga wants only ":2" at the end of his strings, so Kit`s solution could
be
problematic, as it seems to search anywhere within the string...
*************
clear
input str9 var1
"2011017:1"
"2011018:1"
"2011018:2"
"2011026:1"
"2011:20:1"
"2011041:1"
end
count if strpos(var1,":2") > 0
*************
Kit Baum
clear
input str9 var1
"2011017:1"
"2011018:1"
"2011018:2"
"2011026:1"
"2011040:1"
"2011041:1"
end
count if strpos(var1,":2") > 0
*
* 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/