MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / str_sub

Function str_sub

third-party/lua-5.5.0/src/lstrlib.c:85–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84
85static int str_sub (lua_State *L) {
86 size_t l;
87 const char *s = luaL_checklstring(L, 1, &l);
88 size_t start = posrelatI(luaL_checkinteger(L, 2), l);
89 size_t end = getendpos(L, 3, -1, l);
90 if (start <= end)
91 lua_pushlstring(L, s + start - 1, (end - start) + 1);
92 else lua_pushliteral(L, "");
93 return 1;
94}
95
96
97static int str_reverse (lua_State *L) {

Callers

nothing calls this directly

Calls 5

luaL_checklstringFunction · 0.70
posrelatIFunction · 0.70
luaL_checkintegerFunction · 0.70
getendposFunction · 0.70
lua_pushlstringFunction · 0.70

Tested by

no test coverage detected