110,535
社区成员
发帖
与我相关
我的任务
分享
int[,] values = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 5, 8, 6 }, { 3, 7, 2 } };
StringBuilder sb = new StringBuilder();
for (int j = 0; j < values.GetLength(1); j++)
{
for (int i = 0; i < values.GetLength(0); i++)
sb.AppendFormat("{0:D3}", values[i, j]);
sb.Append(';');
}
string r = sb.ToString();
Match match = Regex.Match(r, @"(?<=005008008)\d{3}");
if (match.Success)
Response.Write(int.Parse(match.Value));