C# Uri EscapeDataString
Description
Uri EscapeDataString
converts a string to its escaped
representation.
Syntax
Uri.EscapeDataString
has the following syntax.
public static string EscapeDataString(
string stringToEscape
)
Parameters
Uri.EscapeDataString
has the following parameters.
stringToEscape
- The string to escape.
Returns
Uri.EscapeDataString
method returns A String that contains the escaped representation of stringToEscape.
Example
using System;/*from w w w . ja v a2s.c o m*/
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Uri.EscapeDataString("http://java2s.com/a b.htm"));
}
}
The code above generates the following result.