Strings
基本信息
| 属性 | 值 |
|---|---|
| 类名 | remoteio.common.lib.Strings |
| 方法 | 1 个:wrap(String, int) |
功能
按指定长度对长文本做单词换行(word wrap),把超长单词之间的空格替换为换行符。
实现要点
- 实现方式是对
StringBuilder反复lastIndexOf(" ", ...)找空格再replace成\n, 即不会切断单词本身,只断在单词边界。 - 主要服务于 Documentation 的游戏内手册页排版。
相关条目
- Documentation - 主要使用方
- TextFormatter - 客户端文本格式化