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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version