ユーザーの入力が数値かどうかを確認したい。はいの場合、関数を実行し続けたい場合は、彼に警告して再度実行したい.
Console.WriteLine(String.Concat("choose your action" ,Environment.NewLine ,
"1.Deposit", Environment.NewLine,
"2.Withdraw", Environment.NewLine,
"3.CheckAccount"));
string c = Console.ReadLine();
int value = Convert.ToInt32(c);
if (value==char.IsLetterOrDigit(value)) //<----- no good why?
{
switch (value)
{
case 1:
Deposit();
return;
case 2:
Withdraw();
return;
case 3:
CheckAccount();
return;
}
}