C#中字符串的问题
TextBox的Text属性是string型的,字符串。
判断数的合法性,要是我可能直接用try-catch,省事。
try
{
double。Parse(textBox1。 Text);
MessageBox。Show("Y");
}
catch
{
MessageBox。Show("N");
}
用正则表达式可能比较正规吧。
TextBox的Text属性是string型的,字符串。
判断数的合法性,要是我可能直接用try-catch,省事。
try
{
double。Parse(textBox1。
Text);
MessageBox。Show("Y");
}
catch
{
MessageBox。Show("N");
}
用正则表达式可能比较正规吧。收起