C# Uri UnescapeDataString
Description
Uri UnescapeDataString
converts a string to its unescaped
representation.
Syntax
Uri.UnescapeDataString
has the following syntax.
public static string UnescapeDataString(
string stringToUnescape
)
Parameters
Uri.UnescapeDataString
has the following parameters.
stringToUnescape
- The string to unescape.
Returns
Uri.UnescapeDataString
method returns A String that contains the unescaped representation of stringToUnescape.
Example
The following code example unescapes a URI, and then converts any plus characters ("+") into spaces.
/*from w w w . ja v a 2 s .c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
String DataString = Uri.UnescapeDataString(".NET+Framework");
Console.WriteLine("Unescaped string: {0}", DataString);
String PlusString = DataString.Replace('+',' ');
Console.WriteLine("plus to space string: {0}", PlusString);
}
}
The code above generates the following result.