/
How do I get the length of a string?

How do I get the length of a string?

Q

How do I get the length of a string?

A

With the :len() operator and preceding string variable

Example code:

string_a = “Hello“
len = string_a:len()
-- will result in value 5 for variable len

Related content

How can variables of the type string be merged together?
How can variables of the type string be merged together?
More like this
A part of a string variable shall be assigned to another variable, how does it work?
A part of a string variable shall be assigned to another variable, how does it work?
More like this
How can a variable be created?
How can a variable be created?
More like this
How can I declare special characters in a string?
How can I declare special characters in a string?
More like this
How to convert a string to a numeric value?
How to convert a string to a numeric value?
More like this
Do variables need a data type?
Do variables need a data type?
More like this