Description | The |
Syntax | SEARCH( |
Output | integer |
Variables
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.
The SEARCH()
function is case-sensitive, meaning it will only search text that exactly matches the specified search string in terms of both character sequence and letter case. If you need case-insensitive search, you may consider using REGEX_SEARCH()
to achieve the desired result.
When the SEARCH()
function returns -1, it indicates that there is no matching occurrence of the specified regular expression pattern or offset within the given text.
For example, if a user is looking for specific data and SEARCH()
function returns -1, they might conclude that the desired data is not present in the document.
Example
SEARCH(`Text`,"fox")
ID | Text | SEARCH |
1 | The quick brown fox jumps over a lazy dog. | 17 |
2 | Savant is an intelligent analytics tool. | β1 |
3 | There are no matches in this text. | β1 |