A = read() string = A return string:len()And i can print it out very easily by replacing string:len() with print(string:len())
But how can i store the length in a variable and then do what i need with the variable?
Posted 02 May 2015 - 05:12 PM
A = read() string = A return string:len()And i can print it out very easily by replacing string:len() with print(string:len())
Posted 02 May 2015 - 07:20 PM
length = yourstring:len()
len = yourstring:len() -- this is equivalent to len = string.len(yourstring) -- this
local len = yourstring:len()
len = yourstring:len() -- all of len = string.len(yourstring) -- these len = #yourstring -- do the same
Edited by LBPHacker, 02 May 2015 - 07:25 PM.
Posted 02 May 2015 - 11:32 PM
A = "Hello World" --can i do B = #A
0 members, 1 guests, 0 anonymous users