Skip to main content

String Index Of

This block finds a substring inside a string and outputs its position.

Configuration

  • Input String: the string to search in.
  • Search For: the text to look for.
  • Start Position: zero-based position to start searching from. Default 0 (the beginning of the string).

Connections

  • Result: executed after the search. The position of the first occurrence is available to the following blocks as index.

The position is zero-based, so the first character of the string is at index 0. When the search string is not found, index is -1.

Use an IF Condition block to check for -1 before using the result.

See also Substring