用截取字符串中的数字,代码如下: double d = 0; string str = "hello8023.1314world"; //要截取的字符串 Match m = Regex.Match(str, "\\d+(\\.\\d+){0,1}"); double.TryParse(m.Groups[0].ToString(), out d); Console.WriteLine(d); Console.ReadKey(); 运行截图如下: 相关文章: 2021-12-09 2022-12-23 2021-12-12 2022-02-04 2021-09-17 2021-10-09 2022-03-01 2021-11-15