Skip to content

592530326/glua-strings

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • 为LUA新增获取中文字符串的长度方法
  • **

Go strings package for gopher-lua

hello.go:

package main

import (
	"github.com/yuin/gopher-lua"

	strings "github.com/592530326/glua-strings"
)

func main() {
	L := lua.NewState()
	defer L.Close()

	strings.Preload(L)

	if err := L.DoString(code); err != nil {
		panic(err)
	}
}

hello.lua:

local strings = require("strings")
local a = "你好吗111"
print(strings.Len(a))
print(strings.ToUpper("abc"))

for i, s in ipairs(strings.Split("aa,b,,c", ",")) do
	print(i, s)
end

Run example:

$ go run hello.go

License

The MIT License.

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.7%
  • Lua 3.3%