From: Yan Bernacki Date: 2011-02-10T20:54:19+09:00 Subject: Re: How to split string by x bytes? Now I have this: packets = (data.size.to_f / 256).ceil packets.times do |packet| socket.write data[packet..(packet+256)] end And this is very ugly :( -- Posted via http://www.ruby-forum.com/.