Documentation
¶
Overview ¶
Package strutil 收敛 core 内字符串小工具,消除 executor/service 重复实现。
本包只保留 oekit/pkg 无等价物的路径安全与 CSV 能力(Truncate 按字节截断、 CSVEscape、SanitizeFileToken、SanitizePathToken),其余通用能力已委托给 github.com/oekit/pkg(convert / stringx)。函数签名保持不变,供跨仓直接引用。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizePathToken ¶ added in v0.9.0
SanitizePathToken 路径段安全化:去掉 / \ .. 与空格,防路径穿越。
func TruncateRunes ¶ added in v0.9.0
TruncateRunes 按字符(rune)截断。
委托 oekit/pkg/stringx.FirstN(按 rune 计数,与本包原实现一致)。 差异兜底:FirstN 在 n<=0 时会返回省略号,而本包原语义是空串,故先短路返回 ""。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.