From: Shashank Agarwal Date: 2008-06-30T02:00:22+09:00 Subject: Re: How to doing a "grep -v" to hide "---" line added by Hash#to_yaml ? Stephen Celis wrote: > Which can be, simply: > > {1=>2,"ABC" => {"a"=>"A","b"=>"B"}}.to_yaml[5..-1] > > It may even be slightly more efficient to use String#sub > > {1=>2,"ABC" => {"a"=>"A","b"=>"B"}}.to_yaml.sub("--- \n", '') Awesome. Totally forgot about negative indexes. -- Posted via http://www.ruby-forum.com/.