Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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.IsWellFormedOriginalString() Method in C#
The Uri.IsWellFormedOriginalString() method in C# indicates whether the string used to construct this Uri was well-formed and is not required to be further escaped.
Syntax
Following is the syntax −
public bool IsWellFormedOriginalString ();
Example
Let us now see an example to implement the Uri.IsWellFormedOriginalString() method −
using System;
public class Demo {
public static void Main(){
Uri newURI1 = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI1);
Uri newURI2 = new Uri("https://www.qries.com/");
Console.WriteLine("URI = "+newURI2);
if(newURI1.Equals(newURI2))
Console.WriteLine("Both the URIs are equal!");
else
Console.WriteLine("Both the URIs aren't equal!");
if(newURI1.IsWellFormedOriginalString())
Console.WriteLine("newURI1 is well formed!");
else
Console.WriteLine("newURI1 isn't well formed!");
}
}
Output
This will produce the following output −
URI = https://www.tutorialspoint.com/index.htm URI = https://www.tutorialspoint.com/ Both the URIs aren't equal! newURI1 is well formed!
Advertisements