[plt-scheme] Re: Characters in a String
Eli Barzilay <eli at ...> writes:
> On May 28, David Van Horn wrote:
> > (string-tokenize "Help make programs run, run, RUN!") =>
> > ("Help" "make" "programs" "run," "run," "RUN!")
>
> And if you mention this, then you might as well include
>
> > (regexp-split #rx" +" "Help make programs run, run, RUN!")
> ("Help" "make" "programs" "run," "run," "RUN!")
>
> so you can even do this:
>
> > (regexp-split #rx"[ ,!]+" "Help make programs run, run, RUN!")
> ("Help" "make" "programs" "run" "run" "RUN" "")
Right, but string-tokenize is "standard" among Schemes (if that matters).
Also, you're example could easily be done with SRFI 13 & 14:
(string-tokenize "Help make programs run, run, RUN!"
(char-set-delete char-set:graphic #\, #\!))
David