<pre name="code" class="csharp">
函数:
private bool IsNumeric(string str)
{
int output;
return int.TryParse(str, out output);
}
调用例子:
string str="12345";
if (IsNumeric(str))
MessageBox.Show("纯数字");
else
MessageBox.Show("不是纯数字");
<pre name="code" class="csharp">
函数:
private bool IsNumeric(string str)
{
int output;
return int.TryParse(str, out output);
}
调用例子:
string str="12345";
if (IsNumeric(str))
MessageBox.Show("纯数字");
else
MessageBox.Show("不是纯数字");