This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
GreenGene's profile picture

String size

Started by GreenGene, 05 January 2015 - 10:12 PM
GreenGene #1
Posted 05 January 2015 - 11:12 PM
Hello! i am makeing an api and i need to know how do you get the size of a string (from a var) and put it in another! Thanks!
MKlegoman357 #2
Posted 05 January 2015 - 11:17 PM

local str = "string"

print( #str ) --> 6
--# or
print( str:len() ) --> 6
--# or
print( string.len( str ) ) --> 6