I want to identify those observations of the string variable (x), which contain pair of characters "abs" and "def", in that order: i.e. if "abs" comes before "def".
E.g. I want to identify the observation if x == "he walked to abs and def later" but not if x == "he walked to def and abs later" How can I do this? So far, I have used strpos(). I also posted a related question yesterday but posting a new question as this is a different question.
Many thanks,
Mihir
E.g. I want to identify the observation if x == "he walked to abs and def later" but not if x == "he walked to def and abs later" How can I do this? So far, I have used strpos(). I also posted a related question yesterday but posting a new question as this is a different question.
Code:
tab y if strpos(lower(y), "abs") & strpos (lower(y), "def")
Mihir
Comment