I want to make my PasswordChar in a box empty when a user clicks a button (so they can confirm they wrote it right, it's easier than having to type it twice)
However, when I do:
password.PasswordChar = null;
It says
Cannot convert null to 'char' because it is a non-nullable value type
Setting it to '' says it's an empty char, and ' ' just makes it a space. What do I do?
You can use:
password.PasswordChar = '\0';
\0 refers to a null character.
You should be able to do this:
password.PasswordChar = '\0';
password.PasswordChar = '\u0000';
'\u0000' means null character in Unicode and it does the same thing as '\0'
Beware that single quote is using to represent char.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With