C#Regex中replace方法的替换自定义小数点后的内容
2021-06-16 08:05
阅读:551
标签:ace param 引用 $1 string 应该 log tps sts
- $1应该就是引用了这个组,不用这个会匹配不到
///
/// 截取
///
/// 输入截取数字如-0.3412
/// 截取位数
///
private double Floor(double n, double t)
{
var i = "^([-+]?[0-9]*.[0-9]{" + t + "})[0-9]*$";
string sRestult = Regex.Replace(n.ToString(), i, "$1");
return System.Convert.ToDouble(sRestult);
}
https://www.cnblogs.com/xinjianheyi/p/5791360.html
https://www.cnblogs.com/wangchuang/p/4271809.html
https://www.cnblogs.com/testsec/p/6095529.html
C#Regex中replace方法的替换自定义小数点后的内容
标签:ace param 引用 $1 string 应该 log tps sts
原文地址:https://www.cnblogs.com/TTonly/p/10349907.html
上一篇:C# 委托与事件
下一篇:[APIO2014]回文串
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:C#Regex中replace方法的替换自定义小数点后的内容
文章链接:http://soscw.com/index.php/essay/94501.html
文章标题:C#Regex中replace方法的替换自定义小数点后的内容
文章链接:http://soscw.com/index.php/essay/94501.html
评论
亲,登录后才可以留言!