2008-10-13 36 views
4

Python標準庫隨模塊textwrap提供,它提供了簡單的文本包裝功能。 java標準庫中有什麼可比的東西嗎?Java標準庫中是否有文本包裝功能?

在Python它是這樣的:

>>> 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'] 
+0

您可以加入的一個例子在Python中的功能? – danb 2008-10-13 15:14:30

回答

8

沒有標準的Java庫,但在Apache的百科全書:

WordUtils.wrap

相關問題