casecmp is a String class method in Ruby which is Case-insensitive version of String#<=>. For now, case-insensitivity only works on characters A-Z/a-z, not all of the Unicode characters. This method is different from casecmp! method.
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 true or false 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.
- Ruby | String casecmp? Method
- Ruby | Symbol casecmp function
- Ruby | String chr Method
- Ruby | String =~ Method
- Ruby | String <=> Method
- Ruby | String hex Method
- Ruby | String == method
- Ruby | String === Method
- Ruby | String << Method
- Ruby | String eql? Method
- Ruby | String + Method
- Ruby | String * Method
- Ruby | String gsub Method
- Ruby | String center() method
- Ruby | String insert Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.