I have a requirement to find and extract a number contained within a string.
For example, from these strings:
string test = \"1 test\" string test1 =
string input = "Hello 20, I am 30 and he is 40"; var numbers = Regex.Matches(input, @"\d+").OfType().Select(m => int.Parse(m.Value)).ToArray();