number = {:a => 1,:b => 2,:c => 3,:d => 4}
在评估某些条件时,我想删除a,b,c的键值对
number.delete "A" number.delete "B" number.delete "C"
或者,性能较差但更简单:
number.reject! {|k,v| %w"A B C".include? k }