Page 1 of 1

check if substring in a routine

Posted: Mon May 05, 2008 10:47 pm
by ysrinu
Hi in a BASIC routine,
i can use the FIELD function to extract a substring from a string based on delimiters and instances

How can i check if a string S1 is a substring of S2 or not? The substring can occur at any part of S1

Thanks,
-srinivas yelamanchili

Posted: Mon May 05, 2008 10:56 pm
by DS_SUPPORT
How about using Index Function??

Posted: Mon May 05, 2008 11:07 pm
by bkumar103
You can write your own C++ routine to emulate your requirement.

Posted: Tue May 06, 2008 12:06 am
by chulett
No need to write anything for Server when all kinds of functionality is already built in. As noted, 'Index' is a good answer here and the returned found position of the substring can be treated as a simple true/false Boolean when just checking for existence.

Posted: Tue May 06, 2008 8:46 pm
by ysrinu
INDEX works, thanks to all !