[plt-scheme] Checking if strings are only whitespace

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Mar 19 09:12:15 EST 2006

At Sun, 19 Mar 2006 12:26:28 +0100, Hans Oesterholt-Dijkema wrote:
> The last two solutions are comparable in speed. However, I want a still
> faster solution.

This one is slightly faster (or a lot faster when the JIT is
unavailable or disabled):

  (define (is-space? str)
    (and (regexp-match-positions #rx"^[ \t\r\n]+$" str) #t))


Matthew



Posted on the users mailing list.