STRSTR             ' C style

#include <STRING.bas>                        ' source in /Program Files/Coridium/BASIClib 

FUNCTION STRSTR( searchee, lookfor )


This FUNCTION written in BASIC searches the string  searchee looking for the string lookfor

If it is found, the position of the first character of lookfor in searchee is returned, otherwise -1.

STRSTR is written in C style with 0 being the first character of the string, consistent with VB string.Chars(0).


#include <STRING.bas> 
DIM text(10)
text = "HELLO WORLD" 
PRINT STRSTR(text, "LLO")     ' will display  2
Differences from other BASICs

See also