diff options
Diffstat (limited to '3rdparty/lua/in-lua-extensions/string.lua')
-rw-r--r-- | 3rdparty/lua/in-lua-extensions/string.lua | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/3rdparty/lua/in-lua-extensions/string.lua b/3rdparty/lua/in-lua-extensions/string.lua deleted file mode 100644 index 764f964..0000000 --- a/3rdparty/lua/in-lua-extensions/string.lua +++ /dev/null @@ -1,50 +0,0 @@ --- --- string.lua --- Additions to Lua's built-in string functions. --- Copyright (c) 2002-2008 Jason Perkins and the Premake project --- - - --- --- Returns an array of strings, each of which is a substring of s --- formed by splitting on boundaries formed by `pattern`. --- - - function string.explode(s, pattern, plain) - if (pattern == '') then return false end - local pos = 0 - local arr = { } - for st,sp in function() return s:find(pattern, pos, plain) end do - table.insert(arr, s:sub(pos, st-1)) - pos = sp + 1 - end - table.insert(arr, s:sub(pos)) - return arr - end - - - --- --- Find the last instance of a pattern in a string. --- - - function string.findlast(s, pattern, plain) - local curr = 0 - repeat - local next = s:find(pattern, curr + 1, plain) - if (next) then curr = next end - until (not next) - if (curr > 0) then - return curr - end - end - - - --- --- Returns true if `haystack` starts with the sequence `needle`. --- - - function string.startswith(haystack, needle) - return (haystack:find(needle, 1, true) == 1) - end |