面向 shell 与终端文本的字符串分词、换行、填充和转义辅助库。
- 仓库:
opencomputers - 系统:
openos - 类型:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\text.lua
local text = require("text")- 说明: 转义 Lua 模式里的特殊字符,使字符串能够按字面量匹配。
- 参数:
txt
text.escapeMagic(nil)- 说明: 把
escapeMagic针对 Lua 模式特殊字符添加的转义去掉。 - 参数:
txt
text.removeEscapes(nil)- 说明: 移除字符串首尾的空白字符。
- 参数:
value
text.trim(nil)- OpenOS 会先暴露一个较小的引导期子集,随后在完整模块加载后再补上更丰富的分词和换行工具。