mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOC] Tweaks for String#capitalize
This commit is contained in:
parent
482f4cad82
commit
987b5bf972
1 changed files with 18 additions and 9 deletions
27
string.c
27
string.c
|
@ -8282,20 +8282,29 @@ rb_str_capitalize_bang(int argc, VALUE *argv, VALUE str)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* capitalize(mapping) -> string
|
* capitalize(mapping = :ascii) -> string
|
||||||
*
|
*
|
||||||
* Returns a string containing the characters in +self+;
|
* Returns a string containing the characters in +self+,
|
||||||
* the first character is upcased;
|
* each with possibly changed case:
|
||||||
* the remaining characters are downcased:
|
|
||||||
*
|
*
|
||||||
* s = 'hello World!' # => "hello World!"
|
* - The first character is upcased.
|
||||||
* s.capitalize # => "Hello world!"
|
* - All other characters are downcased.
|
||||||
*
|
*
|
||||||
* The casing may be affected by the given +mapping+;
|
* Examples:
|
||||||
* see {Case Mapping}[rdoc-ref:case_mapping.rdoc].
|
|
||||||
*
|
*
|
||||||
* Related: String#capitalize!.
|
* 'hello world'.capitalize # => "Hello world"
|
||||||
|
* 'HELLO WORLD'.capitalize # => "Hello world"
|
||||||
*
|
*
|
||||||
|
* Some characters do not have upcase and downcase, and so are not changed;
|
||||||
|
* see {Case Mapping}[rdoc-ref:case_mapping.rdoc]:
|
||||||
|
*
|
||||||
|
* '1, 2, 3, ...'.capitalize # => "1, 2, 3, ..."
|
||||||
|
*
|
||||||
|
* The casing is affected by the given +mapping+,
|
||||||
|
* which may be +:ascii+, +:fold+, or +:turkic+;
|
||||||
|
* see {Case Mappings}[rdoc-ref:case_mapping.rdoc@Case+Mappings].
|
||||||
|
*
|
||||||
|
* Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue