Jump to content

if string is longer that 3 chars?


SirniNamaz

Recommended Posts

Posted
  
local s = 'Word' 
if #s > 2 then 
    print( 'more 2 symbols' ) 
end 
  

You can use # or string.len

Also # and string.len doesn't working with unicode. If you need working with unicode use

utfLen 

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...