SpecT Posted May 8, 2015 Posted May 8, 2015 Hello folks! Could you guys tell me how to show a too long text with "..." ? Here is an example: "Asd asd asd asd asd asd long text asd" to "Asd asd asd asd ..." Thanks in advance!
rtx Posted May 8, 2015 Posted May 8, 2015 local maxLen = 8 -- maximum length local a = "Your string here" if #a > maxLen then a = string.sub ( a, 0, maxLen ) .. " ..." end
SpecT Posted May 8, 2015 Author Posted May 8, 2015 local maxLen = 8 -- maximum length local a = "Your string here" if #a > maxLen then a = string.sub ( a, 0, maxLen ) .. " ..." end Thanks dude! It worked like a charm
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now