Skip to main content

SEARCH

The SEARCH function searches for the first position of a specified string within another string. If the specified string is not found, the function returns 0. You can also specify a starting position from which to begin the search.

Syntax​

int SEARCH(string searchText, string value)
int SEARCH(string searchText, string value, int start)

Input​

ObjectData TypeDescription
valueStringThe string to look in.
searchTextStringThe string to find.
startIntegerThe position to start from (1 is the first position).

Example​

Here's an example of using the SEARCH function to find the position of a substring within a string:

SEARCH("world", "hello world")

This would return 6, because the substring "world" begins at the 6th position in the string "hello world".

You can also specify a starting position for the search. For example, to search for the substring Simego starting from the 8th position in the string "Company: Simego" you would use the following:

SEARCH("Simego","Company: Simego",8 )

This would return "2" as "Simego" starts at the second position after the 8th position in the string.