DriveWorks Solo 15: Search [send feedback...]

Syntax

SEARCH( [ FindText], [ WithinText], [ StartNumber] )

FindText is a string of text to be found.

WithinText is the string within which FindText is to be located.

StartNumber is the number of the character within the WithinText string, where the search is to begin.

This function searches the WithinText string for the first occurence encountered of the FindText string, from the StartNumber value.

If no value is entered for the StartNumber, then the search begins with the first character of the WithinText string.

If no occurence of the FindText string is found, then a null value is returned. Otherwise, the number of the first character of the occurence is returned.

Examples

Rule

Meaning
SEARCH("Hello", "And I said Hello to them", 1)Searches the string "And I said Hello to them" for the first occurence of the string "Hello". The search runs from the first character in the WithinText string, which is the letter 'A'. The number of the starting character of the occurence is 12.
SEARCH("Hello", "And I said Hello to them and they said Hello back", 13)Searches the string "And I said Hello to them and they said Hello back" for the first occurence of the string "Hello". The search runs from the thirteenth character in the WithinText string, which is the letter 'e'. The number of the starting character of the occurence is 40.
SEARCH("Hello", "And I said ello to them", 1)Searches the string "And I said ello to them" for the first occurence of the string "Hello". The search runs from the first character in the WithinText string, which is the letter 'A'. No occurence is found, so a null value is returned.

Table of Contents