Uri.Fragment Property in C# with Examples
Last Updated :
08 Jun, 2020
Uri.Fragment Property is instance property which is used to get the escaped URI fragment.
Syntax:
public string Fragment { get; }
Return value: This property returns string that contains any URI fragment information.
Exception: This property throws InvalidOperationException for a relative URI and is valid only for absolute URIs.
Example 1:
C#
using System;
using System.Globalization;
class GFG {
public static void Main()
{
Console.WriteLine( "Uri Fragment: " + v1.Fragment);
}
}
|
Output:
Uri Fragment: #standardGreedyAlgorithms
Example 2:
C#
using System;
using System.Globalization;
class GFG {
public static void Main()
{
Console.WriteLine( "Uri Fragment: " + v1.Fragment);
}
}
|
Output:
Uri Fragment: #approximateGreedyAlgorthms
Share your thoughts in the comments
Please Login to comment...