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

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -