2019-04-03 19:33:36 +03:00
# Text Wrapper Challenge Guideline
2019-04-18 12:33:57 +03:00
In this project your goal is to mimic the soft text wrapping feature of text editors. For example, when there are 100 characters on a line and if the soft-wrapping is set to 40, an editor may cut the line that goes beyond 40 characters and display the rest of the line in the next line instead.
2019-04-03 19:33:36 +03:00
## EXAMPLE
2019-04-18 12:33:57 +03:00
Wrap the given text for 40 characters per line. For example, for the following input, the program should print the following output.
2019-04-03 19:33:36 +03:00
**INPUT:**
2019-04-05 15:06:49 +03:00
2019-04-18 12:33:57 +03:00
Hello world, how is it going? It is ok.. The weather is beautiful.
2019-04-03 19:33:36 +03:00
**OUTPUT:**
2019-04-05 15:06:49 +03:00
2019-04-18 12:33:57 +03:00
Hello world, how is it going? It is ok..
2019-04-05 15:06:49 +03:00
The weather is beautiful.
2019-04-03 19:33:36 +03:00
## RULES
2019-04-18 12:33:57 +03:00
* The program should work with Unicode text. You can find a unicode text in [story.txt ](story.txt ) file.
2019-04-05 15:06:49 +03:00
2019-04-18 12:35:48 +03:00
* The program should not cut the words before they finish. Instead, it should put the whole word on the next line.
2019-04-18 12:33:57 +03:00
2019-04-18 12:35:48 +03:00
For example, this is not OK:
2019-04-18 12:33:57 +03:00
Hello world, how is it goi
ng? It is o
k. The weather is beautifu
l.
2019-04-18 12:35:48 +03:00
2019-04-18 12:33:57 +03:00
## SOLUTION
* [Get the solution source code here ](main.go ).