加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

正则表达式 – 如何将段落重新包装到某个行长度?

发布时间:2020-12-13 22:54:30 所属栏目:百科 来源:网络整理
导读:我有一个很大的段落,我需要分成几行,这样每行不得超过100个字符,不得破坏任何单词.我该怎么做呢?我想正则表达式是最好的方法,但我不知道如何. 使用 Text::Wrap. Text::Wrap::wrap() is a very simple paragraph formatter. It formats a single paragraph a
我有一个很大的段落,我需要分成几行,这样每行不得超过100个字符,不得破坏任何单词.我该怎么做呢?我想正则表达式是最好的方法,但我不知道如何.
使用 Text::Wrap.

Text::Wrap::wrap() is a very simple paragraph formatter. It formats a single paragraph at a time by breaking lines at word boundaries. Indentation is controlled for the first line ($initial_tab) and all subsequent lines ($subsequent_tab) independently.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读