Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace symbol "%" with word "Percent"

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?

Thanks in advance. Atul

like image 636
user211607 Avatar asked May 09 '10 05:05

user211607


1 Answers

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");
like image 170
Kobi Avatar answered Oct 21 '22 02:10

Kobi