@@ -8282,20 +8282,29 @@ rb_str_capitalize_bang(int argc, VALUE *argv, VALUE str)
8282
8282
8283
8283
/*
8284
8284
* call-seq:
8285
- * capitalize(mapping) -> string
8285
+ * capitalize(mapping = :ascii ) -> string
8286
8286
*
8287
- * Returns a string containing the characters in +self+;
8288
- * the first character is upcased;
8289
- * the remaining characters are downcased:
8287
+ * Returns a string containing the characters in +self+,
8288
+ * each with possibly changed case:
8290
8289
*
8291
- * s = 'hello World!' # => "hello World!"
8292
- * s.capitalize # => "Hello world!"
8290
+ * - The first character is upcased.
8291
+ * - All other characters are downcased.
8293
8292
*
8294
- * The casing may be affected by the given +mapping+;
8295
- * see {Case Mapping}[rdoc-ref:case_mapping.rdoc].
8293
+ * Examples:
8294
+ *
8295
+ * 'hello world'.capitalize # => "Hello world"
8296
+ * 'HELLO WORLD'.capitalize # => "Hello world"
8296
8297
*
8297
- * Related: String#capitalize!.
8298
+ * Some characters do not have upcase and downcase, and so are not changed;
8299
+ * see {Case Mapping}[rdoc-ref:case_mapping.rdoc]:
8298
8300
*
8301
+ * '1, 2, 3, ...'.capitalize # => "1, 2, 3, ..."
8302
+ *
8303
+ * The casing is affected by the given +mapping+,
8304
+ * which may be +:ascii+, +:fold+, or +:turkic+;
8305
+ * see {Case Mappings}[rdoc-ref:case_mapping.rdoc@Case+Mappings].
8306
+ *
8307
+ * Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String].
8299
8308
*/
8300
8309
8301
8310
static VALUE
0 commit comments