在go中使用lua示例, 基于gopher-lua!
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
maike 81d90a1d80 初始化 há 4 anos
..
README.md 初始化 há 4 anos
api.go 初始化 há 4 anos
api_test.go 初始化 há 4 anos
loader.go 初始化 há 4 anos

README.md

strings

origin code: https://github.com/vadv/gopher-lua-libs/tree/master/strings

Usage

local strings = require("strings")

-- strings.split(string, sep)
local result = strings.split("a b c d", " ")
-- Output: { "a", "b", "c", "d" }

-- strings.has_prefix(string, prefix)
local result = strings.has_prefix("abcd", "a")
-- Output: true

-- strings.has_suffix(string, suffix)
local result = strings.has_suffix("abcd", "d")
-- Output: true

-- strings.trim(string, cutset)
local result = strings.trim("abcd", "d")
-- Output: abc

-- strings.contains(string, substring)
local result = strings.contains("abcd", "d")
-- Output: true