From: Andreas Schwarz Date: 2004-09-23T19:14:34+09:00 Subject: Re: String#pad ? Jani Monoses wrote: > Hello > > is there a nicer way of padding a string to a power of two length than > for example > > data = data.ljust((data.length+3) & ~3) > > this looks too much like C :) At least a bit more readable: data.ljust(data.size + data.size % 2)