Sharunas Bielskis Sharunas Bielskis - 1 year ago 167
C# Question

How to UrlEncode symbols ( and )

I use System.Net.WebUtility.UrlEncode(myString) to UrlEncode string and get encoded string in uppercase tags after encoding (I found solution .net UrlEncode - lowercase problem). But problem what left for me ar ( and ) encoding. In this case both symbols left uncoded when I need %28 and %29 code instead them. How to solve this problem?

Answer Source

I used this:

myString = myString.Replace("(", "%28").Replace(")", "%29");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download