A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.ruby-lang.org/en/3.4/RubyVM/../case_mapping_rdoc.html below:

case_mapping - Documentation for Ruby 3.4

Case Mapping

Some string-oriented methods use case mapping.

In String:

In Symbol:

Default Case Mapping

By default, all of these methods use full Unicode case mapping, which is suitable for most languages. See Section 3.13 (Default Case Algorithms) of the Unicode standard.

Non-ASCII case mapping and folding are supported for UTF-8, UTF-16BE/LE, UTF-32BE/LE, and ISO-8859-1~16 Strings/Symbols.

Context-dependent case mapping as described in Table 3-17 (Context Specification for Casing) of the Unicode standard is currently not supported.

In most cases, case conversions of a string have the same number of characters. There are exceptions (see also :fold below):

s = "\u00DF" 
s.upcase     
s = "\u0149" 
s.upcase     

Case mapping may also depend on locale (see also :turkic below):

s = "\u0049"        
s.downcase          
s.downcase(:turkic) 

Case changes may not be reversible:

s = 'Hello World!' 
s.downcase         
s.downcase.upcase  

Case changing methods may not maintain Unicode normalization. See String#unicode_normalize).

Options for Case Mapping

Except for casecmp and casecmp?, each of the case-mapping methods listed above accepts optional arguments, *options.

The arguments may be:

The options:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4