From: William James Date: 2007-04-27T19:00:06+09:00 Subject: Re: php's chunk_split alternative in ruby On Apr 27, 4:44 am, Mister Twister wrote: > hello, > how could I chunk_split string > > mylongstring = "some long long long string" > > into smaller strings of length 3. > > In PHP it is > > chunk_split(mylongstring,3); > > What is it in ruby? > > Thank you in advance! > > -- > Posted viahttp://www.ruby-forum.com/. long_string = "some long long long string" p long_string.scan(/.{3}/)