Is there a text wrapping function in the java standard library?

The Python standard library comes with the textwrap module, which provides simple text wrapping functionality. Is there anything comparable in the java standard library?

in Python it is something like this:

 >>> t = "a really really long string with lots of characters" >>> import textwrap >>> textwrap.wrap(t, 20) ['a really really long', 'string with lots of', 'characters'] 
+4
source share
1 answer

There is no Java in the standard library, but there are in Apache Commons:

WordUtils.wrap

+8
source

Source: https://habr.com/ru/post/1277701/


All Articles