No spaces in text field??

I’m trying to make a text box for user name and password authentication and don’t want to allow “spaces” in the text.

I searched forums for an answer and only found how to restrict other characters, but for some reason spaces don’t work. Unity scripting in C# does not even recognize " " as a character.

It seems that for some reason Unity spaces in a text box are a different character than a space in a string???

Any advice would be appreciated… Thanks

" " is not a character, it is a string. ’ ’ is a character.

And if you are talking about a Regex then “\s” will match a whitespace.