Splitting a string into chunks of a certain size

I'm in need to split a string in to multiple sub-string of same size.
Is it possible to split by same or min length using ruby code?

Pasted my message below,

{"Name1 True
Name2 True
Name3 True
Name4 True" }

Expected result on split,

[0]. Name1 True
[1], Name2 True
[2], Name3 False
[3], Name4 True

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.