webCOMAND

#STRPOS

Return the position of the first occurrence of a substring in a string.

Prototype

#STRPOS($haystack, $needle)

Parameters

  • haystack - The string to search in.
  • needle -  The string to search for.

Return

Returns the zero-based position of the first occurrence of needle in haystack.

Example

#/ Position: 8
#LOCAL($Text, "This is some text.")
Position: #STRPOS($Text, "some")

#/ Position: 7
#ASSIGN($Text, "Мощный курс")
Position: #STRPOS($Text, "курс")

Related

#STRRPOS, #STRSTR