Yukihiro Matsumoto wrote:

> Hi,
> 
> In message "How to add a destructive method to the String class..."
>     on 03/03/12, Jeremy <thinker5555 / yahoo.com> writes:
> 
> |all the words in a string, assuming that each word is seperated by a
> |space. I did this, and it works fine:
> |
> |class String
> |    def capwords
> |        self.split.each { |word| word.capitalize! }.join(" ")
> |    end
> |end
> |
> |It does what I need, but it got me thinking.  How would I make this
> |destructive?  In other words, rather than having to do an assingment like
> |this:
> 
> class String
>     def capwords!
>         self.gsub!(/^[a-z]/) {|x| x.upcase }
>     end
> end

Oops, now that I read over your reply, I realize that I wasn't very clear on
what I wanted to accomplish.  I apologize.  I wanted to convert "This s a
title" to "This Is A Title".  The "\b" that Joel used in his demonstration
did what I was looking for.  

I thank you for your reply.

Jeremy