Home » C#

C# | Uri.IsWellFormedOriginalString() Method with Example

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

Uri.IsWellFormedOriginalString() Method

Uri.IsWellFormedOriginalString() method is used to check whether given Uri is well-formed or not, if Uri is well-formed, the method returns true otherwise it returns false.

Syntax:

    bool Uri.IsWellFormedOriginalString();

Parameter(s):

  • It does not accept any parameter.

Return value:

The return type of this method is boolean, it returns true if specified uri is well-formed, otherwise it returns false.

Exception:

    System.InvalidOperationException;

Example to demonstrate example of Uri.IsWellFormedOriginalString() method

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        // Create some Uri objects
        Uri uri = new Uri("https://www.includehelp.com/");
        
        if (uri.IsWellFormedOriginalString())
            Console.WriteLine("uri is well-formed.");
        else
            Console.WriteLine("uri is not well-formed.");
    }
}

Output

uri is well-formed.





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.