mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
[DOC] Tweaks for String#upcase (#15244)
This commit is contained in:
parent
cb9c7a6a0a
commit
59e0489248
Notes:
git
2025-11-20 22:04:24 +00:00
Merged-By: peterzhu2118 <peter@peterzhu.ca>
20
doc/string/upcase.rdoc
Normal file
20
doc/string/upcase.rdoc
Normal file
@ -0,0 +1,20 @@
|
||||
Returns a new string containing the upcased characters in +self+:
|
||||
|
||||
'Hello, World!'.upcase # => "HELLO, WORLD!"
|
||||
|
||||
The sizes of +self+ and the upcased result may differ:
|
||||
|
||||
s = 'Straße'
|
||||
s.size # => 6
|
||||
s.upcase # => "STRASSE"
|
||||
s.upcase.size # => 7
|
||||
|
||||
Some characters (and some character sets) do not have upcased and downcased versions:
|
||||
|
||||
s = 'よろしくお願いします'
|
||||
s.upcase == s # => true
|
||||
|
||||
The casing may be affected by the given +mapping+;
|
||||
see {Case Mapping}[rdoc-ref:case_mapping.rdoc].
|
||||
|
||||
Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String].
|
||||
11
string.c
11
string.c
@ -8001,16 +8001,7 @@ rb_str_upcase_bang(int argc, VALUE *argv, VALUE str)
|
||||
* call-seq:
|
||||
* upcase(mapping) -> string
|
||||
*
|
||||
* Returns a string containing the upcased characters in +self+:
|
||||
*
|
||||
* s = 'Hello World!' # => "Hello World!"
|
||||
* s.upcase # => "HELLO WORLD!"
|
||||
*
|
||||
* The casing may be affected by the given +mapping+;
|
||||
* see {Case Mapping}[rdoc-ref:case_mapping.rdoc].
|
||||
*
|
||||
* Related: String#upcase!, String#downcase, String#downcase!.
|
||||
*
|
||||
* :include: doc/string/upcase.rdoc
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user