#region 判断字符串是否是数字的


/// <summary>
/// 判断是否是数字
/// </summary>
/// <param name="str">字符串</param>
/// <returns>bool</returns>
public bool IsNumeric(string str)
{
if (str == null || str.Length == 0)
return false;
System.Text.ASCIIEncoding ascii
= new System.Text.ASCIIEncoding();
byte[] bytestr = ascii.GetBytes(str);
foreach (byte c in bytestr)
{
if (c < 48 || c > 57)
{
return false;
}
}
return true;
}

#endregion 判断字符串是否是数字的

 

相关文章:

  • 2021-07-29
  • 2021-11-06
  • 2022-01-24
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-22
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案