【发布时间】:2021-03-11 22:04:03
【问题描述】:
我想制作一个微型计算器,如果你写例如 2/3 并且你有 0.6666667。我使用 DynamicExpresso.Core 库,但我需要编写 2f/3f 以获得 0.6666667(如果我编写 2/3 我得到 0)。我想我应该使用像forCounting = Regex.Replace(forCounting, Regex.Match(forCounting, @"\d+").Value, Regex.Match(forCounting, @"\d+").Value + "f"); 这样的想法,但它只在第一个数字之后添加 f。你有什么想法吗?
【问题讨论】:
标签: c# regex replace calculator dynamic-expresso