DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Split A String Into Groups Of 4
s = "ewerweouwroiuwe sdffd sdfds sfdsdf sdf"
s.scan(/.{1,4}/)
#=> ["ewer", "weou", "wroi", "uwe ", "sdff", "d sd", "fds ", "sfds", "df s", "df"]
# or
s.scan(/./).each_slice(4).map(&:join)




