12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
return {
capitalize = function(str)
return string.upper(string.sub(str, 1,1)) .. string.sub(str, 2)
end;
beginswith = function(str,pfx)
if #str < #pfx then return false end
return string.sub(str,1,#pfx) == pfx
end;
endswith = function(str,sfx)
if #str < #sfx then return false end
return string.sub(str,#sfx) == sfx
end;
explode = function(str,delim,pat) -- this is messy as fuck but it works so im keeping it
local i = 1
local tbl = {}
if pat == nil then pat = false end
repeat
|
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
return {
capitalize = function(str)
return string.upper(string.sub(str, 1,1)) .. string.sub(str, 2)
end;
beginswith = function(str,pfx)
if #str < #pfx then return false end
if string.sub(str,1,#pfx) == pfx then
return true, string.sub(str,1 + #pfx)
end
end;
endswith = function(str,sfx)
if #str < #sfx then return false end
if string.sub(str,#sfx) == sfx then
return true, string.sub(str,1,#sfx)
end
end;
explode = function(str,delim,pat) -- this is messy as fuck but it works so im keeping it
local i = 1
local tbl = {}
if pat == nil then pat = false end
repeat
|