in reply to First occurance in a string

See index function: index 'p q' , 'q' will return 2 (success), while index 'p q' , 'r' will return -1 (failure).