Well:
would avoid sticking a space on the end of a string which was originally an exact multiple of 16 characters.$str =~ s/(.{16})(?!\Z)/$1 /g ;
would split any "words" longer than 16 characters.$str =~ s/(\w{16}(?=\w)/$1 /g ;
In reply to Re^2: How to split a string into chunks of length n or less
by gone2015
in thread How to split a string into chunks of length n or less
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |