【发布时间】:2012-08-10 09:42:55
【问题描述】:
这就是我到目前为止所做的
Console.Write("Enter your post code >");
post_code = Console.ReadLine();
if (string.IsNullOrEmpty(post_code))
{
Console.WriteLine("Please enter correct data");
return;
}
else if (post_code.Length != 4)
{
Console.WriteLine("Please enter correct data");
return;
}
我需要:-第一个数字不能是 1、8 或 9。 - 第一个数字必须与下表中的状态匹配:
州:新台币|新南威尔士州|维克|昆士兰|南非|西澳|塔斯|
第一个数字:0 | 2 | 3 | 4 | 5 | 6 | 7 |
【问题讨论】:
标签: c# validation