>>>>> "D" == Daniel Bretoi <lists / debonair.net> writes:

D> btw, I have this solution, but I'd like to know the thory why my other
D> solution didn't work

 When you write

>> newstr = str.gsub(/\b(\s)?([a-z])/,'\1\2'.upcase)

 ruby call the method #upcase for the string '\1\2' and the result is given
 as the second argument of #gsub

 '\1\2'.upcase is the same than '\1\2'


Guy Decoux