From: Robert Dober Date: 2009-08-10T21:03:00+09:00 Subject: Re: Generate binary sequences of length n? On Mon, Aug 10, 2009 at 10:43 AM, Brian Candler wrote: > Robert Dober wrote: >> (1< > Perhaps safer to avoid the interpolation in the format string, using '*' > to give the number of digits. > >>> "%0*b" % [8,123] > => "01111011" Well safer, you mean regarding to my typo, well spotted ;). This is a fascinating idiom I was not aware of. I too prefer it, thx for sharing. Cheers Robert > -- > Posted via http://www.ruby-forum.com/. > > -- module Kernel alias_method :ë, :lambda end