Returns the position of the first occurrence of one string within another.

 

Function returns -1 if the string is not found. The search is case-sensitive.

 

Syntax:

value = FindString( searchString, targetString )

OR

value = Instr( searchString, targetString )     '   Short form usage: "Instr"

 

Parameter:

Description:

searchString

String being searched.

targetString

String which is being looked for in the search string.

value

Position of found targetString, or -1 when not found.  First searchString character is in position 1, not 0.

 

Example:

value = FindString( "Hello", "o" )   '  Returns 5
value = FindString( "Hello", "e" )   '  Returns 2
value = Instr( "Hello", "A" )         '  Returns -1

 

Results:

  See example comments.

 

Links:

 

See Also:

Data Groups and Types

 


Edit Time: 9/25/2017 09:09:56 AM


Topic ID#: 31

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software