On Apr 27, 4:44 am, Mister Twister <kroni... / gmail.com> 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}/)