summaryrefslogtreecommitdiff
path: root/doc/string/downcase.rdoc
blob: d5fffa037b89d0c7fd048363677e0e5c7229dbdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Returns a new string containing the downcased characters in +self+:

  'HELLO'.downcase        # => "hello"
  'STRAẞE'.downcase       # => "straße"
  'ПРИВЕТ'.downcase       # => "привет"
  'RubyGems.org'.downcase # => "rubygems.org"

Some characters (and some character sets) do not have upcase and downcase versions;
see {Case Mapping}[rdoc-ref:case_mapping.rdoc]:

  s = '1, 2, 3, ...'
  s.downcase == s # => true
  s = 'こんにちは'
  s.downcase == s # => true

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