C# checking white space in a textbox -


how can check in c# there white space in textbox , perform operation after that?

this ensures multiple spaces caught in check.

 bool hasallwhitespace = txtbox1.text.length>0 &&                          txtbox1.text.trim().length==0; 

to check single space only:

 bool hassinglewhitespace = txtbox1.text == " "; 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -