C# में Uri.IsWellFormedOriginalString() मेथड इंगित करता है कि इस Uri को बनाने के लिए उपयोग की गई स्ट्रिंग वेल-फॉर्म्ड थी या नहीं और इसे आगे एस्केप करने की आवश्यकता नहीं है।
सिंटैक्स
निम्नलिखित सिंटैक्स है:
public bool IsWellFormedOriginalString ();
उदाहरण
आइए अब Uri.IsWellFormedOriginalString() मेथड को लागू करने का एक उदाहरण देखते हैं:
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.tutorialspoint.com/");
Console.WriteLine("URI = " + newURI2);
if(newURI1.Equals(newURI2))
Console.WriteLine("दोनों URIs समान हैं!");
else
Console.WriteLine("दोनों URIs समान नहीं हैं!");
if(newURI1.IsWellFormedOriginalString())
Console.WriteLine("newURI1 वेल-फॉर्म्ड है!");
else
Console.WriteLine("newURI1 वेल-फॉर्म्ड नहीं है!");
}
}
आउटपुट
यह निम्नलिखित आउटपुट देगा:
URI = https://www.tutorialspoint.com/index.htm URI = https://www.tutorialspoint.com/ दोनों URIs समान नहीं हैं! newURI1 वेल-फॉर्म्ड है!