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

  'hello'.bytes  # => [104, 101, 108, 108, 111]
  'こんにちは'.bytes
  # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]

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