> (define it "cat dog")
> (string-titlecase it)
"Dog Cat" ; So close, but not quite "Dog cat" as I want.
Many thanks.
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You'll want to split the string into a list of words and apply the capitalization function to only the first word.
(define (capitalize-first sentence-str)
(string-join (list-update (string-split sentence-str) 0 string-titlecase)))
Disclaimer: this will do some weird things to the whitespace in sentence-str (e.g. convert newlines to spaces); you might want to tweak that.
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe@googlegroups.com.
Glenn