C# | Uri.IsHexDigit() Method Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Uri.IsHexDigit(Char) Method is used to determine whether a specified character is a valid hexadecimal digit or not. Hexadecimal digits are the digits 0 to 9 and the letters A-F or a-f. Syntax: public static bool IsHexDigit (char character); Here, it takes the character to validate. Return Value: This method returns true if the character is a valid hexadecimal digit otherwise, false. Below programs illustrate the use of Uri.IsHexDigit(Char) Method: Example 1: csharp // C# program to demonstrate the // Uri.IsHexDigit(Char) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // Declaring and initializing address1 char ch = 'a'; // Validating the Character // using IsHexDigit(Char) method bool value = Uri.IsHexDigit(ch); // Displaying the result if (value) Console.WriteLine("{0} is a valid Hexadecimal Digit", ch); else Console.WriteLine("{0} is a not valid Hexadecimal Digit", ch); } } Output: a is a valid Hexadecimal Digit Example 2: csharp // C# program to demonstrate the // Uri.IsHexDigit(Char) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // calling get() method get('a'); get('.'); get('1'); } // defining get() method public static void get(char ch) { // Validating the Character // using IsHexDigit(Char) method bool value = Uri.IsHexDigit(ch); // Displaying the result if (value) Console.WriteLine("{0} is a valid Hexadecimal Digit", ch); else Console.WriteLine("{0} is a not valid Hexadecimal Digit", ch); } } Output: a is a valid Hexadecimal Digit . is a not valid Hexadecimal Digit 1 is a valid Hexadecimal Digit Reference: https://learn.microsoft.com/en-us/dotnet/api/system.uri.ishexdigit?view=netstandard-2.1 Comment More infoAdvertise with us Next Article C# | Uri.FromHex() Method R rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Uri-Class Similar Reads C# | Uri.IsHexEncoding() Method Uri.IsHexEncoding(String, Int32) Method is used to check whether a character in a string is hexadecimal encoded or not. This checks for hexadecimal encoding which follows the pattern "%hexhex" in a string, where "hex" is a digit from 0 to 9 or a letter from A-F (case-insensitive). Syntax: public sta 2 min read C# | Uri.FromHex() Method Uri.FromHex(Char) Method is used to get the decimal value of a hexadecimal digit. Syntax: public static int FromHex (char digit); Here, it takes the hexadecimal digit (0-9, a-f, A-F) to convert. Return Value: This method returns an Int32 value that contains a number from 0 to 15 that corresponds to 2 min read C# | Char.IsDigit() Method In C#, Char.IsDigit() is a System.Char struct method which is used to check whether a Unicode character can be categorized as a decimal digit(radix 10) or not. Valid digits will be the members of the UnicodeCategory.DecimalDigitNumber category. This method can be overloaded by passing different type 3 min read C# | Uri.IsWellFormedOriginalString() Method Uri.IsWellFormedOriginalString() Method is used to show whether the string used to construct this Uri was well-formed and is not required to be further escaped. Syntax: public bool IsWellFormedOriginalString (); Return Value: This method returns true if the string was well-formed otherwise, false. B 2 min read C# | Uri.GetHashCode() Method Uri.GetHashCode() Method is used to get the hash code for the URI. Syntax: public override int GetHashCode (); Return Value: This method returns an Int32 containing the hash value generated for this URI. Below programs illustrate the use of Uri.GetHashCode() Method: Example 1: csharp // C# program t 1 min read C# | Uri.IsBaseOf(Uri) Method Uri.IsBaseOf(Uri) Method is used to determine whether the current Uri instance is a base of the specified Uri instance. Syntax: public bool IsBaseOf (Uri uri); Here, it takes the specified Uri instance to test.Return Value: This method returns true if the current Uri instance is a base of uri otherw 2 min read Like