STRCHR                 ' C style
 
Syntax


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

FUNCTION STRCHR( string , char )

Description


This FUNCTION written in BASIC searches string looking for the first instance of char .String may be a constant or variable string.
If char is not found -1 is returned, otherwise the position of char.

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

Example

#include <STRING.bas> 
  
DIM text(10)
  
text = "HELLO WORLD" 
PRINT STRCHR(text, "W")     ' will display  6
   

Differences from other BASICs

See also