C#-এ Uri.EscapeDataString() পদ্ধতি একটি স্ট্রিংকে তার এস্কেপড উপস্থাপনায় রূপান্তর করে।
সিনট্যাক্স
নিচের সিনট্যাক্স −
public static string EscapeDataString (string str);
উপরে, স্ট্রিং স্ট্র হচ্ছে পালানোর স্ট্রিং।
উদাহরণ
আসুন এখন Uri.EscapeDataString() পদ্ধতি -
প্রয়োগ করার জন্য একটি উদাহরণ দেখিusing System;
public class Demo {
public static void Main(){
string URI1 = "https://www.tutorialspoint.com/index.htm";
Console.WriteLine("URI = "+URI1);
string URI2 = "https://www.tutorialspoint.com/";
Console.WriteLine("URI = "+URI2);
Console.WriteLine("\nEscaped string (URI1) = "+Uri.EscapeDataString(URI1));
Console.WriteLine("Escaped string (URI2) = "+Uri.EscapeDataString(URI2));
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেURI = https://www.tutorialspoint.com/index.htm URI = https://www.tutorialspoint.com/ Escaped string (URI1) = https%3A%2F%2Fwww.tutorialspoint.com%2Findex.htm Escaped string (URI2) = https%3A%2F%2Fwww.tutorialspoint.com%2F