Ruby hash exclude? -


i have check string in hash

 h = {'a'=>'firsthaha','b'=>'sjdh'} 

it's work:

hash.select { |_,v| v.to_s.downcase.include? 'first' }.keys 

but how realize vice versa include?

hash.select { |_,v| v.to_s.downcase.????? 'first' }.keys 

without using active-support exclude?

hash.select { |_,v| !v.to_s.downcase.include? 'first' }.keys #or  hash.reject { |_,v| v.to_s.downcase.include? 'first' }.keys 

Comments

Popular posts from this blog

c++ - rosrun via ssh doesnt start a node properly -

android - questions about switching from C2DM to GCM -

How to resolve Delphi error: Incompatible types: 'PWideChar' and 'Pointer' -