![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
Advertisements