I'm running this function a lot which shortens the name of a string:
function shorten(st)
return string.sub(st,6)
end
function test(input)
local h = shorten(input)
print(""..h)
end
test("helloworld")
I want to write it with a colon like the other functions in this context, which all go like world():context():manager(), not manager(context(world())). I read that using the syntax with the colon passes the first as an argument into the latter, but this does not work:
function shorten(st)
return string.sub(st,6)
end
function test(input)
local h = input:shorten()
print(""..h)
end
test("helloworld")
Is there a way to do this?