Created
December 12, 2014 22:18
-
-
Save trendsetter37/b0fb345d77efcb1daa48 to your computer and use it in GitHub Desktop.
Common Lisp string splitting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun space-split (string) | |
"Parses integer strings right now but can be easily altered for | |
other purposes " | |
(loop for start = 0 then (1+ finish) | |
for finish = (position #\Space string :start start) | |
collecting (parse-integer (subseq string start finish)) | |
until (null finish))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment