Inserts line breaks for spaces, where the position of the line breaks are chosen to provide the most balanced length of each line.
Character string to be broken up
Number of lines to break the string over
Function is intended for a small number of line breaks. The
n argument is not allowed to be greater than 8 as all combinations of possible line breaks are explored.
When there a number of possible solutions that provide equally balanced number of characters in each line, the function returns the character string where the number of spaces are distributed most evenly.
string with line breaks inserted at optimal positions.
1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.