Remove/Trim the end of a string?

I need to remove the end of a string to a fixed count.
For example, I have a string with the character length of 35, I want to trim it to 25.

But I’m not sure which string functions I should use to trim the ends, help appreciated.

string.sub I believe