diff options
| author | BurdetteLamar <burdettelamar@yahoo.com> | 2025-11-21 18:01:35 +0000 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-12-05 19:04:59 -0800 |
| commit | e5e4175dbddb83eb5a53ec0d0cf3a5d0026c7bb9 (patch) | |
| tree | 21609200576eb3d471362daeb01c0f74c571ab5b /doc | |
| parent | da2c67388ab7db8102bd8fba6f8ed43df713ad66 (diff) | |
[DOC] Tweaks for String#upcase
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/string/upcase.rdoc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/doc/string/upcase.rdoc b/doc/string/upcase.rdoc index 5a9cce217f..ad859e8973 100644 --- a/doc/string/upcase.rdoc +++ b/doc/string/upcase.rdoc @@ -1,6 +1,9 @@ Returns a new string containing the upcased characters in +self+: - 'Hello, World!'.upcase # => "HELLO, WORLD!" + 'hello'.upcase # => "HELLO" + 'straße'.upcase # => "STRASSE" + 'привет'.upcase # => "ПРИВЕТ" + 'RubyGems.org'.upcase # => "RUBYGEMS.ORG" The sizes of +self+ and the upcased result may differ: @@ -9,12 +12,16 @@ The sizes of +self+ and the upcased result may differ: s.upcase # => "STRASSE" s.upcase.size # => 7 -Some characters (and some character sets) do not have upcased and downcased versions: +Some characters (and some character sets) do not have upcase and downcase versions; +see {Case Mapping}[rdoc-ref:case_mapping.rdoc]: - s = 'よろしくお願いします' + s = '1, 2, 3, ...' + s.upcase == s # => true + s = 'こんにちは' s.upcase == s # => true -The casing may be affected by the given +mapping+; -see {Case Mapping}[rdoc-ref:case_mapping.rdoc]. +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]. |
