From: Alex Stahl Date: 2010-09-10T09:29:31+09:00 Subject: Re: How to do foo.chomp!.rstrip!.downcase! ? What you're likely running into is that .rstrip! returns nil if no change was made. Check this for more details: http://ruby-doc.org/core/classes/String.html#M000829 -Alex On Thu, 2010-09-09 at 19:23 -0500, Geometric Patterns wrote: > Rather than: > > foo.chomp! > foo.rstrip! > foo.downcase! > > ...it seems like I should be able to do: > > foo.chomp!.rstrip!.downcase! > > ...but I get: undefined method `downcase!' for nil:NilClass > (NoMethodError) > > This is probably a basic ruby thing that I'm not grokking... > > Many thanks in advance, > > - d