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)))
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 55:45:52 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,709 |