This documentation is archived and is not being maintained.

HttpServerUtility.UrlDecode Method (String)

.NET Framework 1.1

URL-decodes a string and returns the decoded string.

[Visual Basic]
Overloads Public Function UrlDecode( _
   ByVal s As String _
) As String
public string UrlDecode(
 string s
public: String* UrlDecode(
 String* s
public function UrlDecode(
   s : String
) : String;


The text string to decode.

Return Value

The decoded text.


URL encoding ensures that all browsers will correctly transmit text in URL strings. Characters such as ?, &,/, and spaces may be truncated or corrupted by some browsers so those characters must be encoded in <A> tags or in query strings where the strings may be re-sent by a browser in a request string.


The following example decodes the string named EncodedString (received in a URL) into the string named DecodedString.

[Visual Basic] 
Dim DecodedString As String = Server.UrlDecode(EncodedString)

String DecodedString = Server.UrlDecode(EncodedString);

String* DecodedString = Server->UrlDecode(EncodedString);

var decodedString : String = Server.UrlDecode(encodedString)


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpServerUtility Class | HttpServerUtility Members | System.Web Namespace | HttpServerUtility.UrlDecode Overload List