summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string.c22
-rw-r--r--string.rb4
2 files changed, 13 insertions, 13 deletions
diff --git a/string.c b/string.c
index 8daf9f1c1b..6b8ed02736 100644
--- a/string.c
+++ b/string.c
@@ -4317,26 +4317,26 @@ static VALUE str_casecmp_p(VALUE str1, VALUE str2);
* call-seq:
* casecmp(other_string) -> -1, 0, 1, or nil
*
- * Compares <tt>self.downcase</tt> and <tt>other_string.downcase</tt>; returns:
+ * Ignoring case, compares +self+ and +other_string+; returns:
*
- * - -1 if <tt>other_string.downcase</tt> is larger.
+ * - -1 if <tt>self.downcase</tt> is smaller than <tt>other_string.downcase</tt>.
* - 0 if the two are equal.
- * - 1 if <tt>other_string.downcase</tt> is smaller.
+ * - 1 if <tt>self.downcase</tt> is larger than <tt>other_string.downcase</tt>.
* - +nil+ if the two are incomparable.
*
+ * See {Case Mapping}[rdoc-ref:case_mapping.rdoc].
+ *
* Examples:
*
- * 'foo'.casecmp('foo') # => 0
+ * 'foo'.casecmp('goo') # => -1
+ * 'goo'.casecmp('foo') # => 1
* 'foo'.casecmp('food') # => -1
* 'food'.casecmp('foo') # => 1
- * 'FOO'.casecmp('foo') # => 0
- * 'foo'.casecmp('FOO') # => 0
- * 'foo'.casecmp(1) # => nil
- *
- * See {Case Mapping}[rdoc-ref:case_mapping.rdoc].
- *
- * Related: String#casecmp?.
+ * 'FOO'.casecmp('foo') # => 0
+ * 'foo'.casecmp('FOO') # => 0
+ * 'foo'.casecmp(1) # => nil
*
+ * Related: see {Comparing}[rdoc-ref:String@Comparing].
*/
static VALUE
diff --git a/string.rb b/string.rb
index a14c81ba2d..f89b8dc660 100644
--- a/string.rb
+++ b/string.rb
@@ -373,8 +373,8 @@
# - #eql?: Returns +true+ if the content is the same as the given other string.
# - #<=>: Returns -1, 0, or 1 as a given other string is smaller than,
# equal to, or larger than +self+.
-# - #casecmp: Ignoring case, returns -1, 0, or 1 as a given
-# other string is smaller than, 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.
#