end_with? is a String class method in Ruby which is used to check if the specified string ends with one of the suffixes given or not.
Parameters: Here, str is the given string.
Returns: true if it matches otherwise return 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.