chai2010 / glua-strings

Go strings package for gopher-lua

Home Page:https://godoc.org/github.com/chai2010/glua-strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Go strings package for gopher-lua

hello.go:

package main

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

	strings "github.com/chai2010/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")

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.

About

Go strings package for gopher-lua

https://godoc.org/github.com/chai2010/glua-strings

License:MIT License


Languages

Language:Go 96.6%Language:Lua 3.4%