Don't ask to ask, just ask | |
PerlMonks |
How can I split a string into chunks of 4 charactersby PetreAdi (Acolyte) |
on Dec 06, 2013 at 16:23 UTC ( [id://1066004]=perlquestion: print w/replies, xml ) | Need Help?? |
PetreAdi has asked for the wisdom of the Perl Monks concerning the following question: For example, string "01234abc" would become array ("0123", "1234","234a","34ab","4abc") I tried @array = $string =~ /(.{1,4})/g; but it doesn't seem to work. Thank you.
Back to
Seekers of Perl Wisdom
|
|