Application Kata "Text wrap"
Write an application with which an entered text can be wrapped at a given column width.
The following illustration shows how the application should look.
The text to be wrapped is entered by the user in a text box. The desired width of the text is also entered (25 characters in the example above). By clicking the Wrap button, the text is wrapped and displayed in the lower text box.
Variation #1
The program can also be implemented as a command line program. The program is then called with the parameters file name and width:
C:> umbreche hänsel-und-gretel.txt 25 Before a great forest lived a poor woodcutter with his wife and his two children; the little boy was called Hansel and the girl Gretel.
Variation #2
The text wrap should be supplemented by hyphenation. Use the Hunspell library [1], for example.
Resources