1. Conclusion </ b>
2. What is the include method </ b>
3. How did you program it? </ B>
Use the include? Method </ b>!
include? Is a method to determine if the specified element is in the array!
def array_hello(strs)
if strs.include?(hello)
puts "True"
else
puts "False"
end
end
I want to find the character "hello" in the argument of "strs", so
It is written as strs.include? (hello)!
You can apply it with the argument .include? (Characters in the array you want to find)!
Recommended Posts