[求助]看了你会惊讶
如何才能够在主函数中调用这段代码:public static bool IsNum(String str)
{
for(int i=0;i<str.Length;i++)
{
if(!Char.IsNumber(str,i))
return false;
}
return true;
}
主要有bool关键字的存在,小生不知如何调用,望各位大虾不吝赐教,在此感激不尽。
using System; class My { static void Main() { IsNum("xun"); System.Threading .Thread .Sleep (10000); } public static bool IsNum(String str) { for(int i=0; i<str.Length ;i++) { if(!char.IsNumber (str,i)) { Console.Write ("This method is used!!"); return false; } } return true; }
}