i'm trying to create a GUI and i need to get the number of characters in the text Box like do i do TextBox.Length or something?? please help thank you
Yes! You can use a string function on the Text
property of the TextBox
to get the length of the current text.
Here is some sample code (assuming the LocalScript
is inside of the TextBox
print(string.len(script.Parent.Text)) -- prints the length of the TextBox text when the script is ran
Learn more about the methods I used here: https://developer.roblox.com/api-reference/class/TextBox https://developer.roblox.com/articles/Lua-Libraries/string
(Did this answer help? Mark it as the correct answer/upvote it to help me out!)