No such thing as a small change | |
PerlMonks |
Re: substr questionby linuxer (Curate) |
on Jun 18, 2010 at 16:50 UTC ( [id://845408]=note: print w/replies, xml ) | Need Help?? |
I modified your problem definition into: How to split a string into several substrings (of a given maximum length) without breaking a word when splitting. I found this (quickly hacked) solution:
Limitation: If the given string doesn't contain any whitespace (\x20), it won't split at all. If you just want/need the first substring, just use the first returned element. Updates:
In Section
Seekers of Perl Wisdom
|
|