Just a random question, no specific use, the title says it all
print(string.len("Hello World!")) --> 12 Characters
There are multiple solutions to this:
local str = "Hello!" local sol_1 = string.len(str) local sol_2 = utf8.len(str) -- shouldn't be used for this purpose but it works local sol_3 = str:len() local sol_4 = #str
I would overall recommend the usage of the
#, @desinied 's Solution isnt recommended as usage of the
# operator is faster than
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.