local returnN = function(n, str) if n == 0 then return "" else return string.sub(str, -n) end end print(returnN(0, "abc")) print(returnN(1, "abc"))