Extracting the last N characters of string in Lua?

Viewed 14421

I would like to extract the last N characters from a Lua string.

What way I could use to achieve this?

2 Answers

You can also use this variant:

('Hello world'):sub(-5)  --> world
Related