vl-string-search

(vl-string-search pattern string [start_position])

The vl-string-search function searches the specified text string for a specified pattern, starting at the specified position.

Arguments

pattern specifies a text string containing the pattern to search for.

string specifies the text string to be searched in.

start_position specifies the starting position of the search by an integer (position 0 specifies the first character). If the argument is omitted, the function uses 0 for the start position.

Return Value

The function returns an integer representing the position in the search string where the specified pattern was found. If the pattern did not match, the function returns nil.

Examples

: (vl-string-search "rec" "forecast")

2

: (vl-string-search "rec" "forecast" 4)

nil