

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Uri.HexEscape(Char) Method in C#
The Uri.HexEscape() method in C# is used to convert a specified character into its hexadecimal equivalent.
Syntax
Following is the syntax −
public static string HexEscape (char ch);
Above, the parameter ch is the character to convert to hexadecimal representation.
Example
Let us now see an example to implement the Uri.HexEscape() method −
using System; public class Demo { public static void Main(){ char ch = 'k'; string res = Uri.HexEscape(ch); Console.WriteLine("Hexadecimal Equivalent = "+res); } }
Output
This will produce the following output −
Hexadecimal Equivalent = %6B
Example
Let us now see another example to implement the Uri.HexEscape() method −
using System; public class Demo { public static void Main(){ char ch = 'P'; string res = Uri.HexEscape(ch); Console.WriteLine("Hexadecimal Equivalent = "+res); } }
Output
This will produce the following output −
Hexadecimal Equivalent = %50
- Related Questions & Answers
- Uri.IsBaseOf(Uri) Method in C#
- Uri.MakeRelativeUri(Uri) Method in C#
- Char.ToUpperInvariant(Char) Method in C#
- Char.ToLowerInvariant(Char) Method in C#
- Difference Between URL and URI
- How to get file URI reference in Java?
- Difference between char s[] and char *s in C
- Convert Image to Data URI with JavaScript
- Difference between const char* p, char * const p, and const char * const p in C
- Char Struct in C#
- State the differences between URI and URL in Computer Network.
- Declare char arrays in C#
- How to convert an std::string to const char* or char* in C++?
- How to convert a std::string to const char* or char* in C++?
- char vs string keywords in C#
Advertisements