[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Titlecase

John.Cowan wrote:
> I think this SRFI should have char-titlecase and string-titlecase
> functions.  The former maps a lowercase or uppercase character into
> its titlecase equivalent, and leaves all other characters alone.
> The latter titlecases its first character and lowercases all the rest;
> it's trivial to define string-titlecase given char-titlecase, but it's
> IMHO worth having for symmetry.

String-titlecase is part of SRFI 13, although with different semantics
from what you describe.  For example:

(string-titlecase "--capitalize tHIS sentence.") =>
  "--Capitalize This Sentence."

string-titlecase  s [start end] -> string
string-titlecase! s [start end] -> unspecified

"For every character c in the selected range of s, if c is preceded by a
cased character, it is downcased; otherwise it is titlecased."