C#中函数怎样去掉末尾的0和小数点

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 05:40:50
C#中函数怎样去掉末尾的0和小数点

C#中函数怎样去掉末尾的0和小数点
C#中函数怎样去掉末尾的0和小数点

C#中函数怎样去掉末尾的0和小数点
哥们,如下
string floatValue = "23.000";
floatValue = floatValue.TrimEnd('.','0');
Console.WriteLine(floatValue);