[DOC] Tweaks for String#casecmp? (#13810)

This commit is contained in:
Burdette Lamar 2025-07-07 14:14:56 -05:00 committed by GitHub
parent c2c0c220a8
commit e9d7e105ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 14 deletions

View file

@ -4411,22 +4411,21 @@ str_casecmp(VALUE str1, VALUE str2)
* casecmp?(other_string) -> true, false, or nil
*
* Returns +true+ if +self+ and +other_string+ are equal after
* Unicode case folding, otherwise +false+:
*
* 'foo'.casecmp?('foo') # => true
* 'foo'.casecmp?('food') # => false
* 'food'.casecmp?('foo') # => false
* 'FOO'.casecmp?('foo') # => true
* 'foo'.casecmp?('FOO') # => true
*
* Returns +nil+ if the two values are incomparable:
*
* 'foo'.casecmp?(1) # => nil
* Unicode case folding, +false+ if unequal, +nil+ if incomparable.
*
* See {Case Mapping}[rdoc-ref:case_mapping.rdoc].
*
* Related: String#casecmp.
* Examples:
*
* 'foo'.casecmp?('goo') # => false
* 'goo'.casecmp?('foo') # => false
* 'foo'.casecmp?('food') # => false
* 'food'.casecmp?('foo') # => false
* 'FOO'.casecmp?('foo') # => true
* 'foo'.casecmp?('FOO') # => true
* 'foo'.casecmp?(1) # => nil
*
* Related: see {Comparing}[rdoc-ref:String@Comparing].
*/
static VALUE

View file

@ -375,8 +375,7 @@
# equal to, or larger than +self+.
# - #casecmp: Ignoring case, returns -1, 0, or 1 as
# +self+ is smaller than, equal to, or larger than a given other string.
# - #casecmp?: Returns +true+ if the string is equal to a given string after Unicode case folding;
# +false+ otherwise.
# - #casecmp?: Ignoring case, returns whether a given other string is equal to +self+.
#
# === Modifying
#