shell:Shell-ish 字符串拆分器。 它支持带空格的带引号的字符串

时间:2021-06-16 22:24:10
【文件属性】:
文件名称:shell:Shell-ish 字符串拆分器。 它支持带空格的带引号的字符串
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-16 22:24:10
Go 壳样式文本处理 Shell-ish文本处理算法合集 支持带引号的字符串的拆分器。 外壳的转义/取消转义字符串 安装 $ go get github.com/shibukawa/shell 参考 分裂 func Parse(src string) []string 按空格拆分 src 字符串。 如果块被引用,双引号之间的空格将被忽略。 import "github.com/shibukawa/shell" func parse () { opts := shell . Parse ( `foo bar baz "hello world"` ) // opts[0] = "foo" // opts[1] = "bar" // opts[2] = "baz" // opts[3] = "hello world" } 逃脱 func Escape(s
【文件预览】:
shell-master
----README.rst(1KB)
----escape_test.go(1KB)
----parser.go(1KB)
----parser_test.go(746B)
----LICENSE.rst(1KB)
----common_test.go(101B)
----escape.go(2KB)

网友评论