summaryrefslogtreecommitdiff
path: root/doc/string/chars.rdoc
blob: 97ea07331f4c46694a0acdc07f19e0e500fcae0f (plain)
1
2
3
4
5
6
7
8
Returns an array of the characters in +self+:

  'hello'.chars     # => ["h", "e", "l", "l", "o"]
  'Привет'.chars    # => ["П", "р", "и", "в", "е", "т"]
  'こんにちは'.chars # => ["こ", "ん", "に", "ち", "は"]
  ''.chars          # => []

Related: see {Converting to Non-String}[rdoc-ref:String@Converting+to+Non--5CString].