index of

This block is part of the value group and was last modified in core v10.4.28.

index of v10.4.28

Finds the given value in its value.

In pins 2
  • value required
    value

    The value to search index on.

  • keyword required
    value

    The keyword to find within this value.

Out pins 2
  • index
    number

    Returns the first index matching the keyword.

  • match
    condition

    Returns true in case a match was found.

Outputs the UTF-16 code-unit index (JS String#indexOf semantics, NOT a byte offset) of the FIRST case-SENSITIVE occurrence of keyword in value, or -1 when absent; matched mirrors index > -1. An empty keyword matches at index 0.

A typical wiring for index of: value feeds the value pin; value feeds the keyword pin; the index out pin feeds cast to value.

Studio canvas example for the index of block: typical wiring for index of.

Version history

Introduced in v10.4.28.


Back to value Return to the main group to view all sub-groups Back to value Return to the group to view all blocks within this group