ruby - using include method in a case statement ruby - using include method in a case statement ruby ruby

ruby - using include method in a case statement


Try this

jasdeep = "RAILS"case jasdeepwhen /IL/  puts "Hello"end


jasdeep = "RAILS"case  when jasdeep.include?("AI")    puts "Hello"end


That nil is the returned value from the puts statement, not from .include?. Try to run the following two statements separately from the console and observe the returned value:

jasdeep.include? "AI"puts "hello"