Skip to content

Instantly share code, notes, and snippets.

View kennyheaton's full-sized avatar
🐢
Turtle power

Super Dad kennyheaton

🐢
Turtle power
  • Love's
  • Edmond, OK
  • 03:29 (UTC -06:00)
View GitHub Profile
@siguremon
siguremon / split-str.l
Created August 27, 2011 04:38
split string function in common lisp
(defun split-str (string &optional (separator " "))
(split-str-1 string separator))
(defun split-str-1 (string &optional (separator " ") (r nil))
(let ((n (position separator string
:from-end t
:test #'(lambda (x y)
(find y x :test #'string=)))))
(if n
(split-str-1 (subseq string 0 n) separator (cons (subseq string (1+ n)) r))