Build/Utilities/strings.lua

7 lines
216 B
Lua

function string.starts(input, suffix)
return suffix == "" or string.sub(input, 1, string.len(suffix)) == suffix
end
function string.ends(input, ending)
return ending == "" or input:sub(-#ending) == ending
end