casecmp? is a String class method in Ruby which is used to return true if both the string are equal after Unicode case folding and false if they are not equal.
Parameters: Here, str is the given string to be checked and other_str is the string to which str is compared.
Returns: This method will returns the numbers based on the equality of the str and other_str. It can also return nil if the two strings have incompatible encodings, or if other_str is not a string.
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.