Hi, I have a problem in Ruby that I can't solve, I already tried to google it, but nothing. I hava an array. I want to use the select method to select tthe elements that contains the string "YES" or the string "NO". It doesn't work: a.select { |x| x.include? "YES" || x.include? "NO" } Can anyone help me? Thanks!
This works Code: #!/usr/bin/ruby a = ["Pradeep","Yes","YES","NO"] print a.select { |x| x.include?("YES") || x.include?("NO") }
Thank you, it works! It works only with the '(' and ')', and without the white space after 'include?'.