Skip to content

Commit 0604d0c

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Tweaks for String#capitalize!
1 parent 987b5bf commit 0604d0c

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

string.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8242,22 +8242,14 @@ rb_str_downcase(int argc, VALUE *argv, VALUE str)
82428242

82438243
/*
82448244
* call-seq:
8245-
* capitalize!(mapping) -> self or nil
8245+
* capitalize!(mapping = :ascii) -> self or nil
82468246
*
8247-
* Upcases the first character in +self+;
8248-
* downcases the remaining characters;
8249-
* returns +self+ if any changes were made, +nil+ otherwise:
8250-
*
8251-
* s = 'hello World!' # => "hello World!"
8252-
* s.capitalize! # => "Hello world!"
8253-
* s # => "Hello world!"
8254-
* s.capitalize! # => nil
8255-
*
8256-
* The casing may be affected by the given +mapping+;
8257-
* see {Case Mapping}[rdoc-ref:case_mapping.rdoc].
8247+
* Like String#capitalize, except that:
82588248
*
8259-
* Related: String#capitalize.
8249+
* - Changes character casings in +self+ (not in a copy of +self+).
8250+
* - Returns +self+ if any changes are made, +nil+ otherwise.
82608251
*
8252+
* Related: See {Modifying}[rdoc-ref:String@Modifying].
82618253
*/
82628254

82638255
static VALUE

0 commit comments

Comments
 (0)