[SOLVED] How to trim a string

How would I print the first 5 characters of a string in LUA? I’ve been poring over the http://www.lua.org/pil stuff for a while now and cant come up with it. I KNOW I’ve done it before, but I’m on my first cup of coffee.

Any clues or hints would be appreciated!!!

Best,
Mario

[UPDATE] Solved!!

print(string.sub(tempString,1,15)) – Will print the first part of ‘tempString’ from 1 to the 15th character.

Stupid strings!! BLAH! [import]uid: 11636 topic_id: 16460 reply_id: 316460[/import]

Thank for sharing!

Regards, [import]uid: 89165 topic_id: 16460 reply_id: 61478[/import]

Anything I can do to help out others, you bet!! :slight_smile:

-Mario [import]uid: 11636 topic_id: 16460 reply_id: 61480[/import]

Hey Mario,
Thanks! =]

PS: When I get to be able to “help” others as you do and said above, WOW, I`ll be really happy as well! Cannot wait for this time…oh God…:slight_smile:
See yah mate,
Rodrigo. [import]uid: 89165 topic_id: 16460 reply_id: 61483[/import]