ccInstr

Syntax

UINT = ccInstr(Target:String,Search:String,OPT Pos = 0:Uint,OPT DirectionRight = False:Uint,OPT CaseSensitive = True:Uint),Uint

Description

Finds the first occurrence of a search string -from the left- in a target string.

Parameters

target - String to perform the search on.
search - String to search for.
pos - Optional ones based starting position to begin the search.-Valid from the left if DirectionRight = False or from the right by DirectionRight = True-
By Pos = 0 and DirectionRight = False '0' will be replaced by '1' by DirectionRight = True '0' will be replaced by LEN(Target) with that you get Direction dependent OPT for Pos
Direction (boolean)- Optional point of view that determines from where the Pos and Return value are counted from.
CaseSensitive - (boolean) - Optional parameter for Case(in)Sensitive search.

Return value

Returns the ones based position of the first occurrence of the search string in the target string.-from the left-
Valid from the left if DirectionRight = False or from the right by DirectionRight = True
Returns 0 if the search string could not be found.

Remarks

None

Example usage

A$ = "A string to search for something"
PRINT ccInstr(A$,"search",5,True,False)

See
ccRev-Instr_DEMO.eba
ccRevInstr()