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 =
For those who want decimal number from a string with Regex in TWO line:
decimal result = 0; decimal.TryParse(Regex.Match(s, @"\d+").Value, out result);
Same thing applys to float, long, etc...