C# checking white space in a textbox

后端 未结 9 1070
孤独总比滥情好
孤独总比滥情好 2021-01-03 06:45

How can I check in C# that is there a white space only in a textbox and perform some operation after that?

9条回答
  •  梦谈多话
    2021-01-03 07:19

    if (System.Text.RegularExpressions.Regex.IsMatch(textBox1.Text, @"\s",)) {
        // do your code
    }
    

提交回复
热议问题