我必须分析 12 位数字。所以我被困在第 7 和第 8 个数字之间。我想如果数字是 40(数字 7 是 4,数字 8 是 0)给我“ex.London”,如果是 45 给我“ex.NY”......
代码 :
[WebMethod]
public string ID(string number)
{
int fullInt = Int32.Parse(number);
string City1= number.Substring(0, 2);
string City1_S = "Date of birth: " + City1;
string City2 = number.Substring(2,2);
string City2_S = "Month: " + City2;
string City3 = number.Substring(4, 3);
string City3_S = "Year: 1" + City3;
string City4 = number.Substring(7, 2).Contains("40").ToString();
string City4_S = "City: London";
string[] Array= new string[3];
Array[0] = City1_S.ToString();
Array[1] = City2_S.ToString();
Array[2] = City3_S.ToString();
Array[3] = City4_S.ToString();
return Array.ToString();
}