替换符号“%"带有“百分比"字样 [英] Replace symbol "%" with word "Percent"

查看:56
本文介绍了替换符号“%"带有“百分比"字样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用单词百分比"替换符号%".

How to replace symbol "%" with a word "Percent".

我的原始字符串是内部 (%) 外部 (%)".字符串应为内部(百分比)外部(百分比)"

My original string is "Internal (%) External (%)". The string should be "Internal (Percent) External (Percent)"

使用正则表达式,如何替换这个符号?

Using regular expression, how I can replace this symbol?

提前致谢.阿图尔

推荐答案

这里不需要正则表达式,可以使用常规替换.例如使用.net:

You don't need a Regex here, you can use a regular replace. For example using .net:

string s = "Internal (%) External (%)";
s = s.Replace("%", "Percent");

这篇关于替换符号“%"带有“百分比"字样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆