Skip to content

Find substring (index) (text_indexOf)

What it does: Finds the first or last occurrence of a substring in text.

text_indexOf

Inputs

  • VALUE: the text you are looking for.
  • FIND: Searched substring.
  • Setting block END: FIRST or LAST.

Output

  • number (index of occurrence found, or -1 if not found).

When to use it

  • Parsing commands and finding delimiters.
  • Checking if the text contains the expected tag.

Tips and pitfalls

  • Search is case sensitive.
  • The meaning of the index (0-based/1-based) depends on the workspace settings, be consistent.
  • Searching for an empty substring may return a result that does not make practical sense.