Char
The nth element (zero-based) of a string
(Char s n) is the nth element of s, zero-based. If
n is greater than or equal to the length of s, then char
returns nil.
(Char s n) has a guard that n is a non-negative integer
and s is a stringp.
Char is a Common Lisp function. See any Common Lisp documentation for
more information.
Function: char
(defun char (s n)
(declare (xargs :guard (and (stringp s)
(integerp n)
(>= n 0)
(< n (length s)))))
(nth n (coerce s 'list)))