110,571
社区成员
发帖
与我相关
我的任务
分享
6087
6088
6
6090
60
dsfds
6092
60
6094
sdsf
string yourStr = @"6087
6088
6
6090
60
dsfds
6092
60
6094
sdsf
";
MatchCollection mc = Regex.Matches(yourStr, @"\d+");
if (mc.Count == 0) return;
int n = int.Parse(mc[0].Value);
for (int i = 1; i < mc.Count; i++)
{
n = Math.Max(n, int.Parse(mc[i].Value));
}
MessageBox.Show(n.ToString());