Thanks Peter, it works fine.


Peter Szinek wrote:
> ilhamik wrote:
> > hi,
> > I want to downcase a string but without specific parts.
> > for example:
> > msg = "THIS is a Text and (NO Change HERE) HELP"
>
> Hi,
>
> This is kind of old school and I am sure there are nicer rubyish
> solutions for it, but at least it works for multiple parentheses as well:
>
> original = msg.scan(/\(.+?\)/)
> msg.downcase!
> altered = msg.scan(/\(.+?\)/)
> original.each_with_index { |stuff, i| msg.sub!(altered[i],stuff) }
> 
> --
> Peter
> http://www.rubyrailways.com