MCPcopy Index your code
hub / github.com/yuin/gopher-lua / strSub

Function strSub

stringlib.go:414–425  ·  view source on GitHub ↗
(L *LState)

Source from the content-addressed store, hash-verified

412}
413
414func strSub(L *LState) int {
415 str := L.CheckString(1)
416 start := luaIndex2StringIndex(str, L.CheckInt(2), true)
417 end := luaIndex2StringIndex(str, L.OptInt(3, -1), false)
418 l := len(str)
419 if start >= l || end < start {
420 L.Push(emptyLString)
421 } else {
422 L.Push(LString(str[start:end]))
423 }
424 return 1
425}
426
427func strUpper(L *LState) int {
428 str := L.CheckString(1)

Callers

nothing calls this directly

Calls 6

luaIndex2StringIndexFunction · 0.85
LStringTypeAlias · 0.85
CheckStringMethod · 0.80
CheckIntMethod · 0.80
OptIntMethod · 0.80
PushMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…