[plt-scheme] string-upper-case

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Sun Oct 25 10:13:39 EDT 2009

Eli Barzilay wrote:
> On Oct 24, Neil Van Dyke wrote:
>> I have often wondered why R5RS didn't have a procedure that accepts
>> a string and returns a new string that is like the input one but
>> with all the likely names of cats in it capitalized.
>
> `string-titlecase' will do that.  (Cat name likelihood proof left as  
> an exercise.)


Point of note - string-titlecase does both the upping and the downing  
of case, which may be a good or a bad thing depending on what you're  
trying to achieve:

     (string-titlecase  "Welcome to PLT!") ; => "Welcome To Plt!"

For what it's worth there's a variant in unlib.plt called "string- 
titlecase*" that only does the upping part:

     (string-titlecase* "Welcome to PLT!") ; => "Welcome To PLT!"

I've found this useful from time to time.

Hope this helps,

-- Dave



Posted on the users mailing list.