![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.FromHex() Method in C#
The Uri.FromHex() method in C# is used to get the decimal value of a hexadecimal digit.
Syntax
Following is the syntax −
public static int FromHex (char digit);
Above, the parameter digit is the hexadecimal digit (0-9, a-f, A-F) to convert.
Example
Let us now see an example to implement the Uri.FromHex() method −
using System; public class Demo { public static void Main(){ char ch = 'D'; Console.WriteLine("Character value = "+ch); int res = Uri.FromHex(ch); Console.WriteLine("Converted int value = "+res); } }
Output
This will produce the following output −
Character value = D Result = 13
Example
Let us now see another example to implement the Uri.FromHex() method −
using System; public class Demo { public static void Main(){ char ch = '6'; Console.WriteLine("Character value = "+ch); int res = Uri.FromHex(ch); Console.WriteLine("Result = "+res); } }
Output
This will produce the following output −
Character value = 6 Result = 6
Advertisements