My one character string prints Nothing

Hello,

I am trying to make a search system for my game

The issue is if the query is a One character string then my “Showing Results for [query here]” TextLabel always “Showing Results for [nothing]” when I set TextLabel’s Text

There isn’t or I couldn’t find any documentation about this issue or a Devforum post. I also tried printing query but it printed “[nothing]”

Script:

print(query)
SearchPage.TextLabel.Text = "Showing results for " .. query

Output:

I assume that this is how Lua deals with One Character Strings. So, if there is any other way of doing this. It would be Helpful :smiley:

If you are wondering about what query is, It is “d”

That’s not how Lua deals with one character strings.
That would make no sense.

Could you show a bit more code with the searching system?

Alternatively, you could try doing this. But I do not guarantee it to work.

print(query)
SearchPage.TextLabel.Text = ("Showing results for %s"):format(query)
1 Like

It looks like you are right because I set the TextLabel’s Text before I set the search bar back to “[nothing]”

Thanks for the help.