From: phlip Date: 2008-06-30T06:32:30+09:00 Subject: Re: How to doing a "grep -v" to hide "---" line added by Hash#to_yaml ? Shashank Agarwal wrote: >> {1=>2,"ABC" => {"a"=>"A","b"=>"B"}}.to_yaml.sub("--- \n", '') > > Awesome. Totally forgot about negative indexes. I would use the .sub option because it is explicit about what it is removing. However, the Hash did not add the --- . It is part of the YAML standard as the start of a document. You should consider leaving it alone, because other YAML tools will like it. -- Phlip