Jump to content

Text stuff


SpecT

Recommended Posts

Posted

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!

Posted
  
local maxLen = 8 -- maximum length 
local a = "Your string here" 
if #a > maxLen then 
    a = string.sub ( a, 0, maxLen ) .. " ..." 
end 
  

Posted
  
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 :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...