Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: match(s1,s2) function

From   "Nick Cox" <>
To   <>
Subject   RE: st: match(s1,s2) function
Date   Wed, 7 Aug 2002 14:16:15 +0100

Lee Chuntao 

> >     I want to evalute if S1 is a substring of S2, for 
> example, "str" is a 
> > sbustring of "substring" . To my great disappointed, the 
> match(s1,s2) 
> > only works as the "==" operator. Can anyone help me?

Fred Wolfe 

> Use the index function and test if index(S2,S1) == 0

I agree with Fred that this problem sounds more 
like one for -index()-, but I do not understand 
Lee's disappointment here. Either something matches a pattern, 
or it doesn't. What else have you in mind? 


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index