Seiki Batch Script > String Functions

find

Reports the index position of the first occurrence of a specified string within a string

Class: String

Parameters:  $string – The string to be searched

                     $search – The search string

Syntax: index=find($string, $search)

Returns:

•      If $search is found – The index of $search in $string as an integer

•      If $search is not found – -1

Remarks:

•      The returned index starts at 0

•      Search criteria is case insensitive

Example:

//Example for the string find method

$s=”05/01/67” //Set string

$srch=”/” //Set search string

idx=find($s, $srch) //Result (= 2)

message(“Search string “ + $srch + “ found at index “ + idx) //Display results message

 

See Also:    findr