From: Logan Capaldo Date: 2006-06-22T04:20:40+09:00 Subject: Re: Convert String to BinaryString On Jun 21, 2006, at 2:13 PM, Michael stepanov wrote: > Hi guys, > > Once I already asked how to create a hex string in �little-endian� > order > in Ruby. In this case the most appropriate way is to use function > sprintf() or "%". But > those function return aString but I need aBinarystring. So, my > question > is how to convert aString to aBinarystring? > > Thanks in advance. > > > -- > Posted via http://www.ruby-forum.com/. > % irb irb(main):001:0> 12.to_s(2) => "1100" irb(main):002:0> "12".to_i.to_s(2) => "1100"