类别:程序开发
日期:2020-12-19 浏览:3161 评论:0
代码块:
private static string strs(string str) { if (str.IndexOf(".") > 0) { str =Regex.Replace(str.Trim(),"0+?$", " "); str =Regex.Replace(str.Trim(),"[.]$", " "); } return str; }
调用方式:
string a = "100.00"; string b = strs(a);
本文标题:如何在 C# 去除数值后面多余的数字“0”
本文链接:https://vtzw.com/post/497.html
版权声明:本文不使用任何协议授权,您可以任何形式自由转载或使用。
发表评论 / 取消回复