method

bytes

v1_8_7_72 - Show latest stable - Class: String
bytes()
public

Returns an enumerator that gives each byte in the string. If a block is given, it iterates over each byte in the string.

   "hello".bytes.to_a        #=> [104, 101, 108, 108, 111]