Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 40 |
Nodes: | 6 (0 / 6) |
Uptime: | 10:45:00 |
Calls: | 291 |
Files: | 910 |
Messages: | 76,430 |
Something like this function will tell you the position of
the last comma in a string.
(defun find-last-comma (s)
(loop for n from 0 below (length s)
if (char= (aref s n) #\,)
do
(if (and (loop for n downfrom (1- (length s)) to 0
if (char= (aref n s) #\,)
return n
finally (return nil))
(= n (loop for n downfrom (1- (length s)) to 0
if (char= (aref s n) #\,)
return n
finally (return nil))))
(return-from find-last-coma n))
finally (return nil)))