Python标准库附带textwrap
了一个提供简单文本环绕功能的模块.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']
Brandon DuRe.. 8
标准Java库中没有,但Apache Commons中有:
WordUtils.wrap
标准Java库中没有,但Apache Commons中有:
WordUtils.wrap