C# में Uri.IsHexEncoding() मेथड यह निर्धारित करता है कि स्ट्रिंग में कोई वर्ण हेक्साडेसिमल एन्कोडेड है या नहीं।
सिंटैक्स
निम्नलिखित सिंटैक्स है:
public static bool IsHexEncoding (string pattern, int index);
ऊपर, पैटर्न पैरामीटर जांचने के लिए स्ट्रिंग है, जबकि इंडेक्स पैटर्न में हेक्साडेसिमल एन्कोडिंग की जांच के लिए स्थान है।
उदाहरण
आइए अब Uri.IsHexEncoding() मेथड को लागू करने का एक उदाहरण देखते हैं:
using System;
public class Demo {
public static void Main(){
string pattern = "%50";
bool res = Uri.IsHexEncoding(pattern, 0);
if (res)
Console.WriteLine("वैध: हेक्साडेसिमल एन्कोडेड");
else
Console.WriteLine("अवैध: हेक्साडेसिमल एन्कोडेड");
}
}
आउटपुट
यह निम्नलिखित आउटपुट देगा:
वैध: हेक्साडेसिमल एन्कोडेड
उदाहरण
आइए अब Uri.IsHexEncoding() मेथड को लागू करने का एक और उदाहरण देखते हैं:
using System;
public class Demo {
public static void Main(){
string pattern = "%60";
bool res = Uri.IsHexEncoding(pattern, 1);
if (res)
Console.WriteLine("वैध: हेक्साडेसिमल एन्कोडेड");
else
Console.WriteLine("अवैध: हेक्साडेसिमल एन्कोडेड");
}
}
आउटपुट
यह निम्नलिखित आउटपुट देगा:
अवैध: हेक्साडेसिमल एन्कोडेड