FindString Function

Top  Previous  Next

Returns the position of the first occurrence of one string within another. FindString returns -1 if the string is not found. The search is case-sensitive.

 

Short form: "instr".

 

Syntax

 

value = FindString( stringToSearch, targetString )

 

Parameters

stringToSearch

 

string being searched

targetString

 

he string which is being looked for in the other string




returns

 

the one-based position or -1 if not found

 

Examples

The following examples illustrate the use:

 

value = FindString( "Hello", "o" )         ' Returns 5

value = FindString( "Hello", "e" )         ' Returns 2

value = FindString( "Hello", "A" )         ' Returns -1