InsertLinebreaks¶
Inserts line breaks into a string so that each line is at most a given number of characters (default 78). Words are kept whole where they fit and packed greedily; a word longer than the width is hard-broken.
Wrapping happens at spaces when possible.
A string already shorter than the width is returned unchanged.