in reply to How to wrap text to a maximum width of 70 characters per line?
ie, split lines that are more than 70 chars long and include no spaces. I think that covers all my bases, and I think the loop is needed, but am not sure - too tired to test, but you get the idea... :)$paragraph =~ s/([^\n]{50,70})(?:\b\s*|\n)/$1\n/gi; while ($paragraph =~ m/([^\n]{71})/) { $paragraph =~ s/([^\n]{70})([^\n])/$1\n$2/g; }
cLive ;-)
*When I was a kid, I was locked in my bedroom. I learnt English from an ABBA record. It was hard, but if I had to do the same again, I would my friend.
Fernando
- Milton Jones
Originally posted as a Categorized Answer.
|
|---|