Home > Software engineering >  How can I decode and encode m/s to m/s in .NET?
How can I decode and encode m/s to m/s in .NET?

Time:07-14

I have some units as "m/s". But, in dotnet I get the value as "m/s". How can I decode and encode it back? I tried using the following but didn't work.

HttpUtility.HtmlDecode("m/s");
HttpUtility.HtmlEncode("m/s");
System.Convert.ToBase64String("m/s");
System.Convert.FromBase64String("m/s");

CodePudding user response:

using System.Web;
Console.WriteLine(HttpUtility.UrlDecode("m/s"));
Console.WriteLine(HttpUtility.UrlEncode(@"m/s"));

result

m/s
m/s
  • Related