如何使用console.readline
時檢查字符串中是否有數字值?c#如何檢查字符串是使用console.readline時的數字
PlayerNode playerList = new PlayerNode();
for (int x = 1; x <= numPlayers; x++)
{
Console.WriteLine("What is your name?");
Player Aplayer = new Player();
Aplayer.Name = Console.ReadLine();
playerList.AddPlayer(Aplayer);
Console.WriteLine("How Much money do you want to play with?");
Aplayer.Winnings = float.Parse(Console.ReadLine());// How would i change this to check for number values?
}
下次使用谷歌!在谷歌寫這篇文章:c#如何檢查字符串是一個數字。 – mybirthname 2014-10-05 05:14:32