next up previous

12.3.4 Searching a String

The str-index function will return the position of a string inside another string.

Syntax

(str-index  <lexeme-expression> <lexeme-expression>)

where the second argument is searched for the first occurrence of the first argument. The str-index function returns the integer starting position, counting from one, of the first argument in the second argument or returns the symbol FALSE if not found.

Example

CLIPS> (str-index "def" "abcdefghi")
4
CLIPS> (str-index "qwerty" "qwertypoiuyt")
1
CLIPS> (str-index "qwerty" "poiuytqwer")
FALSE
CLIPS>


next up previous