Hi,

I tried the below small fragments in my IRB :


$ 'A'.unpack('b*')
=> ["10000010"]


$ 'A'.unpack('B*')
=> ["01000001"]


$ "hello".unpack('B*')
=> ["0110100001100101011011000110110001101111"]


$ "hello".unpack('C*').map {|e| e.to_s 2}
=> ["1101000", "1100101", "1101100", "1101100", "1101111"]


But couldn't understand the logic. So any help would be appreciated!


Thanks,

-- 
Posted via http://www.ruby-forum.com/.