[racket] Rationale behind missing string-trim
--- On Wed, 5/9/12, Chad Albers <calbers at neomantic.com> wrote:
> I did write my own string-trim-both function using Racket's
> regexp as follows:
>
> (define (string-trim-both string)
> (cadr (regexp-match #px"[\\s]*(\\S+)[\\s]*" string)))
Note: emails to this mailing-list should be in plain text.
(string-trim-both " foo bar ")
==> "foo"
(define (string-strip str)
(regexp-replace* #px"^\\s+|\\s+$" str ""))
(string-strip " \t foo bar \t ")
==> "foo bar"