[racket] Rosetta code submission / string operations
An hour ago, Daniel Prager wrote:
>
> (define (in? str sub-str)
> (not (string=? str (string-replace str sub-str ""))))
>
> Is there something I could have used out-of-the-box?
No -- eventually there should be these two things:
(string-index str sub [start 0] [end (string-length str)])
(list-index list elt [=? equal?])
but I'm not sure about the names.
10 minutes ago, Tobias Hammer wrote:
> I think regexp are the right choice:
Yes,
> (regexp-match? (regexp sub-str) str))
but it should be
(regexp-match? (regexp-quote sub) str)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!