From: Mark Wilson Date: 2003-09-24T03:24:14+09:00 Subject: Re: [newbie] upper to lower first letter of a word On Tuesday, September 23, 2003, at 12:34 PM, Yvon Thoraval wrote: > Recently, i get a vintage list (more than 500 items) with poor typo, > for > example, i've : > > C�te de beaune-villages > > instead of : > > C�te de Beaune-Villages > > Cr�mant d'alsace > > instead of : > > Cr�mant d'Alsace > > i wonder of the way to change lower to upper case and also of > > a regex able to do the trick. > > something like : > > every letter following a " ", "-" or "'" should be upper if not > belonging to a black list of words : > > black_list = %w{d de du la le sec sur entre etc...} You might adapt the English language 'titlecase' program, which can be found here: http://zem.novylen.net/ruby/titlecase.rb Regards, Mark