strpos

Description

Finds the numeric position of the first instance of a character or string within another string.

Copy
 integer strpos( string haystack, string needle[, integer offset] )

Finds the numeric position of the first instance of needle in the haystack string.

  • haystack is the string to search through.
  • needle is the substring to match in haystack.
  • offset is the index (starting at 0) of the string to start at.

Example

{strpos('Sailthru and Zephyr are fun and games','and')}   =  9
{strpos('Sailthru and Zephyr are fun and games','and',20)}   =  28