-
-
Notifications
You must be signed in to change notification settings - Fork 6
Url
Taiizor edited this page Mar 1, 2023
·
22 revisions
The UrlExtension
class in the Skylark.Standard.Extension.Url
namespace provides extension methods for URL encoding and decoding.
Below are example usages of all methods in the UrlExtension
class:
Encodes the specified URL.
Name | Description |
---|---|
Url |
The version of the URL to be encoded. The default value is the Skylark.Standard.Manage.Url.UrlManage.Url constant. |
The encoded URL.
string url = "https://www.example.com/search?q=skylark";
string encodedUrl = UrlExtension.Encode(url);
Console.WriteLine(encodedUrl); // Output: "https%3A%2F%2Fwww.example.com%2Fsearch%3Fq%3Dskylark"
Encodes the specified URL asynchronously.
Name | Description |
---|---|
Url |
The version of the URL to be encoded. The default value is the Skylark.Standard.Manage.Url.UrlManage.Url constant. |
The encoded URL.
string url = "https://www.example.com/search?q=skylark";
string encodedUrl = await UrlExtension.EncodeAsync(url);
Console.WriteLine(encodedUrl); // Output: "https%3A%2F%2Fwww.example.com%2Fsearch%3Fq%3Dskylark"
Decodes the specified URL.
Name | Description |
---|---|
Url |
The version of the URL to be decoded. The default value is the Skylark.Standard.Manage.Url.UrlManage.Url constant. |
The decoded URL.
string encodedUrl = "https%3A%2F%2Fwww.example.com%2Fsearch%3Fq%3Dskylark";
string decodedUrl = UrlExtension.Decode(encodedUrl);
Console.WriteLine(decodedUrl); // Output: "https://www.example.com/search?q=skylark"
Decodes the specified URL asynchronously.
Name | Description |
---|---|
Url |
The version of the URL to be decoded. The default value is the Skylark.Standard.Manage.Url.UrlManage.Url constant. |
The decoded URL.
string encodedUrl = "https%3A%2F%2Fwww.example.com%2Fsearch%3Fq%3Dskylark";
string decodedUrl = await UrlExtension.DecodeAsync(encodedUrl);
Console.WriteLine(decodedUrl); // Output: "https://www.example.com/search?q=skylark"
- Tax
- Url
- Web
- Ping
- Port
- Text
- Time
- Hash
- Word
- Color
- Speed
- Lottery
- Storage
- Browser
- Unicode
- Password
- JavaScript
- Cryptology
- Typography
- Temperature
- Compression
- Decompression
- Cascading Style Sheets
- JavaScript Object Notation
- Hypertext Markup Language
- Extensible Markup Language
- Extensible HyperText Markup Language