-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtensions.cs
30 lines (28 loc) · 998 Bytes
/
Extensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Text;
using System.Web;
namespace ProtocolHandler
{
public static partial class Extensions
{
/// <summary>
/// Converts a string that has been encoded for transmission in a URL into a decoded string.
/// </summary>
/// <param name="str">The string to decode.</param>
/// <returns>A decoded string.</returns>
public static String UrlDecode(this String str)
{
return HttpUtility.UrlDecode(str);
}
/// <summary>
/// Converts a URL-encoded string into a decoded string, using the specified encoding object.
/// </summary>
/// <param name="str">The string to decode.</param>
/// <param name="e">The that specifies the decoding scheme.</param>
/// <returns>A decoded string.</returns>
public static String UrlDecode(this String str, Encoding e)
{
return HttpUtility.UrlDecode(str, e);
}
}
}