【发布时间】:2016-10-24 21:01:41
【问题描述】:
我有一个如下字符串(例如):
Testing stackoverflow 6
Testing stackoverflow 67
Testing stackoverflow 687
Testing stackoverflow 6789
现在我知道一个事实,每次字符串都会以一个数字值结束。我需要取出这个数字...它可以是 1 到 5000 之间的任何数字...我认为使用 lambda 表达式无济于事,因为我无法确定这个数字有多大,所以我想通的正则表达式可能是解决这个问题的好方法,但是如何呢?
编辑:
当我从正则表达式中取出数字并像这样存储时:
int somevalue = Convert.ToInt32(whatever regex takes out);
// Now I have to remove the number from the string...
有人知道吗?
【问题讨论】: