我有这个
hash = {"foo"=>nil,"bar"=>false,"zoo"=>"monkey","loo"=>"","hoo"=>" "}
我想拒绝foo, loo和hoo
做那件事的合适方法是什么?
code
p hash.delete_if{|_,v| v.to_s.strip.empty? }