show / hide menu

GetIndex

Syntax

GetIndex(String, FindString, StartIndex)

Parameters

  • String: (string) The parent string in which to search.
  • FindString: (string) The value to be found within the parent string.
  • StartIndex: (string, optional) The starting point for the search.

Description

The GetIndex function finds the index of a specified substring within a parent string, starting from an optional index.

Example with Optional Value

MessageBox(GetIndex(“Hello, this is a sample string.”, “is”, 5))

The function GetIndex(“Hello, this is a sample string.”, “is”, 5) will search for the substring “is” starting from the 5th index of the string.

Figure1: Rule

Figure2: Preview

In the string “Hello, this is a sample string.”, searching for “is” starting from index 5 will find “is” at index 9. Thus, GetIndex(“Hello, this is a sample string.”, “is”, 5) returns 9.

Example without Optional Value

MessageBox(GetIndex(“Hello, this is a sample string.”, “sample”))

The function GetIndex(“Hello, this is a sample string.”, “sample”) will search for the substring “sample” within the string.

Figure1: Rule

Figure2: Preview

In the string “Hello, this is a sample string.”, searching for the substring “sample” will find it starting at index 17. Thus, GetIndex(“Hello, this is a sample string.”, “sample”) returns 17.