include? is a String class method in Ruby which is used to return true if the given string contains the given string or character.
Parameters: Here, str is the given string.
Returns: true if the given string contains the given string or character otherwise false.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.