Skip to main content
Returns the position of the N-th substring in a string. If N is a negative number, the search will start from the end of the string. Positions start with 1. If not found, 0 is returned.

Syntax

Parameters

  • str: The string in which to find the substring.
  • substr: The substring to find.
  • instance: The N-th substring instance to find. If this item is set to a negative value, the search will start from the end of the string. Default Value: 1.

Return value

Returns an integer. 0 is returned if the substring is not found.

Examples

Keywords

STRPOS, STRING, POSITION, SUBSTRING