In particular, I would like the text sent to the user of OutputStream to have word wrap, so that when the text goes to a new line, the words are not broken. So instead:
The quick brown fox j umps over the lazy do g.
It will appear in the console as follows:
The quick brown fox jumps over the lazy dog.
One option that I know of is to write a method like this to wrap text to a specific character width:
wrapText(String text, int width)
But I would prefer that the text simply automatically snap to the current width of the user console. Is there any way to do this? Any objects in java that can help me? Thanks!
source share