[racket] Rosetta code submission / string operations
I've just submitted a Racket solution to Rosetta Code for "I before E
except after C" (no stretch goal yet).
http://rosettacode.org/wiki/I_before_E_except_after_C
and noticed a couple of seeming omissions from the basic string operations,
or more likely the documentation. I ended up rustling up a quick and dirty
test for whether one string includes another as a substring:
(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 doubt I could have
used regular expressions, but that seemed like overkill. I was also unable
to locate code for searching strings.
Other feedback on my rosetta code also most welcome.
-- Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130604/cc5b21e2/attachment.html>