I am trying to remove text of TextBox, my problem is that of course you can't do
TextBox.Text = nil
I tried doing
TextBox.Text = ""
But this has one problem i am trying to fix, it's not making the text empty, it is adding some invisible character to it which results in PlaceholderText to not be visible because the text is not empty, there is that space, how would i remove it? I tried using string.sub
, no result.
Thanks, kirda
From what I've tried, this returns a length of 0:
local text = script.Parent.Text -- blank text print(#string.char(string.byte(text))) -- 0
I'm assuming whatever character it's adding isn't shown but adds to the string length. Have you possibly considered printing the length of the string to see if that character is there? If the length is 1, there's a character being added. PlaceholderText
only works if #text
is 0.
try just going into the textlabel properties and scroll down to "text:" then remove everything from it. don't put a space or anything, just leave it blank. it worked for me so i don't know why it couldn't work for you...
The only way I can think of making it appear blank is to use a space
TextBox.Text = " "