概要
String#each_byte {|byte| ... } -> self
String#each_byte -> Enumerator
詳細
文字列の各バイトに対して繰り返す。
ブロックを省略すると、 Enumerator を返却
サンプルコード
'hoge'.each_byte { |e|print e, ',' } puts 'hoge'.each_byte { |e|print (e + 1).chr } puts each_hoge = 'hoge'.each_byte puts each_hoge.class puts each_hoge.map { |e|(e - 32).chr }.join
出力
104,111,103,101, iphf Enumerator HOGE