Home » C#

C# | Uri.IsHexDigit() Method with Example

Uri.IsHexDigit() Method: Here, we are going to learn about the IsHexDigit() method of Uri class with example in C#.
Submitted by Nidhi, on March 28, 2020

Uri.IsHexDigit() Method

Uri.IsHexDigit() method is a static method to check given character is a hex digit or not. It returns true if a given character is hex digit, otherwise, it returns false.

Syntax:

    bool Uri.IsHexDigit (char ch);

Parameter(s):

  • char ch – represents the character to be checked for hex digit.

Return value:

The return type of this method is string, it returns a Boolean value.

Example to demonstrate example of Uri.IsHexDigit() method

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        char ch1 = 'e';
        char ch2 = 'g';

        if (Uri.IsHexDigit(ch1))
            Console.WriteLine("It is hex digit");
        else
            Console.WriteLine("It is not hex digit");

        if (Uri.IsHexDigit(ch2))
            Console.WriteLine("It is hex digit");
        else
            Console.WriteLine("It is not hex digit");
    }
}

Output

It is hex digit
It is not hex digit





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.