ruby/doc/string/upcase.rdoc
2025-11-20 17:03:58 -05:00

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].