SEARCH
Searches for a specific search string within a text and returns the index of the first occurrence
Description
The SEARCH()
function is used to locate the starting position of a specific search string within a given text. It returns the character position of the first occurrence of the search string, or -1 if no match is found. This function is useful for tasks like pattern recognition and data extraction.
Syntax
SEARCH(text
, search
)
text
: The input text string in which you want to search for the search string.search
: The search string you want to find within the text.
Example
Table
ID
Text
1
The quick brown fox jumps over a lazy dog.
2
Savant is an intelligent analytics tool.
3
There are no matches in this text.
Function
SEARCH(`Text`, "fox")
Results
SEARCH(Text, "fox")
17
-1
-1
Last updated