Symisc Systems

Libcox Command Reference


Star Follow @symisc

Command Syntax

strpos haystack needle [offset = 0]


Alias

None


Description

Returns the numeric position of the first occurrence of needle in the haystack string.


Parameters

haystack

The input string.

needle

Search pattern (must be a string).

offset

Optional Parameter: This optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.


Return Value

Integer: Returns the position as an integer. If needle is not found, strpos will return FALSE. Use libcox_value_to_int() to extract the processing result.