Ruby: how to split a string into equal chunks

Wednesday, July 14th, 2010 | tech

“some long test string or other”.scan(/.{15}/)

Snagged from http://snippets.dzone.com/posts/show/5621 and posted here so I can find it later.

No comments yet.

Leave a comment

Amazon Wish List