(vl-string-position character_code string [start_position [backward_flag]])
The vl-string-position function searches a specified string for a specified character code starting at a specified position.
Both forward and backward searches are possible.
character_code specifies the character to be searched by providing its character code as integer.
string specifies the text string to be evaluated.
start_position specifies the position where to begin searching within the text string (position 0 specifies the first character). If the argument is omitted, the function uses 0 for the start position.
backward_flag determines whether the search is performed from the end to the beginning of the text string (when set to anything but nil).
The function returns an integer representing the displacement at which the character was found. The function returns nil if the character was not found.
Examples
: (vl-string-position 65 "ABCD" 0)
0
: (vl-string-position 65 "ABCD" 1 T)
3
: (vl-string-position 65 "DCBA" 0)
3
: (vl-string-position 65 "DCBA" 1)
3
: (vl-string-position (ascii "A") "DCBA" 3)
3
: (vl-string-position 65 "abcd" 0)
nil