Home » C#

C# | Uri.CheckSchemeName() Method with Example

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

Uri.CheckSchemeName() Method

Uri.CheckSchemeName() method is a static method that returns a boolean value, if the specified scheme is valid then it returns true otherwise it returns false.

Syntax:

    bool Uri.CheckSchemeName(string SchemeName);

Parameter(s):

  • string SchemeName – represents the specified SchemeName to be checked, it is valid or not.

Return value:

The return type of this method is Boolean, it returns a boolean value, if the specified scheme is valid then it returns true otherwise it returns false.

Example to demonstrate example of Uri.CheckSchemeName() method

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        bool isValid = false;

        Uri domainUri1;
        
        domainUri1 = new Uri("https://www.includehelp.com/index.html");
        
        isValid=Uri.CheckSchemeName(domainUri1.Scheme);
        if (isValid == true)
            Console.WriteLine("Valid Scheme");
        else
            Console.WriteLine("Invalid Scheme");
    }
}

Output

Valid Scheme





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.