mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
21 lines
611 B
Plaintext
21 lines
611 B
Plaintext
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].
|