在go中使用lua示例, 基于gopher-lua!
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
maike 81d90a1d80 初始化 il y a 4 ans
..
README.md 初始化 il y a 4 ans
api.go 初始化 il y a 4 ans
api_test.go 初始化 il y a 4 ans
loader.go 初始化 il y a 4 ans

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