I would like to extract the last N characters from a lua string.
How could I use this?
Use string.sub with a negative index.
string.sub
Example
string.sub("Hello world", -5) -- => world
local n = 3 local mystring = "I am to lazy to google a solution or read the Lua manual" local nLastCharacters = string.sub(mystring, -n)