using
System;
using
System.Text;
using
System.Globalization;
class
GFG {
public
static
void
Main()
{
try
{
for
(
int
i = 1; i <= 3000; i++)
address1.Append(
"abcedfghijklmnopdjdjdjdjdjjddjjdjdj"
);
string
value = Uri.EscapeDataString(address1.ToString());
Console.WriteLine(
"Escaped string is : {0}"
, value);
}
catch
(ArgumentNullException e)
{
Console.WriteLine(
"stringToEscape can not be null"
);
Console.Write(
"Exception Thrown: "
);
Console.Write(
"{0}"
, e.GetType(), e.Message);
}
catch
(UriFormatException e)
{
Console.WriteLine(
"Length of stringToEscape should"
+
" not exceed from 32766 characters."
);
Console.Write(
"Exception Thrown: "
);
Console.Write(
"{0}"
, e.GetType(), e.Message);
}
}
}