Guf*_*ffa 10
如果在字符串中的任何其他情况下没有出现百分比,则甚至不需要正则表达式:
s = s.Replace("%", "/100");
Run Code Online (Sandbox Code Playgroud)
要添加括号,您需要使用正则表达式:
s = Regex.Replace(s, @"(\d{1,3})%", "($1/100)");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2184 次 |
| 最近记录: |