Hello everyone! I´m trying to make a variable where a number of letters turn into a number. I have tried tonumber(textlabel.Text)
and tostring(textlabel.Text)
but both didn´t work. So please, can someone say how to do it and explain how it works. Thanks!
try printing textlabel.Text and see if its actually number as text because if it is then tonumber(text) would make it number
You mean turning 1
to 1 or one
to 1?
Letter “one” has three letters. So one = 3
use #textlabel.Text
charssss
Have a question, what does # mean?
#
is the length operator in Lua.
Basicly # is used to get length of string/arrays (tables)
so if you have lets say #{1,2,3,5} will return 4 since the length of table is 4
#string returns the length of string
print(type(#textlabel.Text))
it should print number. If it does then you can do whatever you want with it.
It works! The topic is now closed.
print(string.len(textlabel.Text))
should work too I think
Yes, string.len() will work too.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.