indexOf
The string indexOf task finds the position (index) of a specific character or group of characters within a given string. By default, characters in a string are indexed from left to right. The indexOf task is also case-sensitive. In conjunction with other workflow tasks, this task is useful when you need to find the first instance (or all instances) of a specific character.
Potential use case
Suppose you are attempting to extract email domains from user email addresses, and you need to isolate the exact position of the @ symbol in the email address. Using indexOf will allow you to obtain the information you need.
Properties
Example 1
In this example:
- The
strvariable has been statically set asabcabcdabcde. - The
searchValuevariable isabcd. - The
fromIndexis set to0, indicating the search should start at the beginning of the line. Numbering starts at zero. - The output
indexwill be3, which represents the first instance of where “abcd” can be found in thestrvariable (at character position 3).

Example 2
In this example:
- The
strvariable has been statically set assales@itential.com. - The
searchValuevariable has been statically set as@. - The
fromIndexis set to0, indicating the search should start at the beginning of the line. Numbering starts at zero. - The output
indexwill be5, because the first instance of the value@occurs at character position 5 in thestrvariable.

indexOf task with str sales@itential.com and searchValue @