Hello there, For my matchmaking system I’d like to know how to detect how many characters are in a text for example:
That will be a text with 5 characters in it and I’d like to know how to detect how much characters there is.
Any help is appreciated, Thanks!
local text = "Karozza" --7 characters
print(#text) -- Prints 7
Not sure if that’s what you wanted
So if I were to do:
local TextBoxText = TextBox.Text
if #TextBoxText == 20 then
It would detect 20 characters?, I never knew you could use the Length operator on a string
That would be correct if there are 20 characters in the text provided. If there are less or more than 20 it will not print
Remember that spaces count as well
local text = "Karozza And Yes"
print(#text) -- Prints 15
oh lol i didnt even know that this was possible, i always used string.len(text). thanks for sharing!