| From: Laurent (laurent.orseau at gmail.com) Date: Thu Apr 19 08:30:31 EDT 2012 |
|
(define (string-split str [sep #px"\\s+"])
> (remove* '("") (regexp-split sep str)))
>
Nearly, I meant something more like this:
(define (string-split str [splitter " "])
(regexp-split (regexp-quote splitter) str))
No regexp from the user POV, and much easier to use with little knowledge.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120419/d77b363b/attachment.html>
| Posted on the dev mailing list. |
|