C# | Uri.CheckSchemeName(String) Method Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Uri.CheckSchemeName(String) Method is used to determine whether the specified scheme name is valid or not. Syntax: public static bool CheckSchemeName (string schemeName); Here, it takes the scheme name to validate. Return Value: This method returns a Boolean value true if the scheme name is valid otherwise, false. Below programs illustrate the use of Uri.CheckSchemeName() Method: Example 1: csharp // C# program to demonstrate the // Uri.CheckSchemeName(string) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // Declaring and initializing Uri Uri uri = new Uri("https://www.geeksforgeeks.org"); // Determining the Scheme of the Uri string scheme = uri.Scheme; // using CheckSchemeName() method bool value = Uri.CheckSchemeName(scheme); // Displaying the result if (value) Console.WriteLine("Scheme name is valid"); else Console.WriteLine("Scheme name is invalid"); } } Output: Scheme name is valid Example 2: csharp // C# program to demonstrate the // Uri.CheckSchemeName(string) Method using System; using System.Globalization; class GFG { // Main Method public static void Main() { // Declaring and initializing Uri Uri uri = new Uri("https://www.pierobon.org/iis/review1.htm.html#one"); // Determining the Scheme of the Uri string scheme = uri.Scheme; // using CheckSchemeName() method bool value = Uri.CheckSchemeName(scheme); // Displaying the result if (value) Console.WriteLine("Scheme name is valid"); else Console.WriteLine("Scheme name is invalid"); } } Output: Scheme name is valid Reference: https://learn.microsoft.com/en-us/dotnet/api/system.uri.checkschemename?view=netstandard-2.1 Comment More infoAdvertise with us Next Article C# | Uri.HexEscape(Char) Method R rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Uri-Class Similar Reads C# | Uri.CheckHostName(String) Method Uri.CheckHostName(String) Method is used to determine whether the specified host name is a valid DNS name or not. Syntax: public static UriHostNameType CheckHostName (string name); Here, it takes the host name to validate. This can be an IPv4 or IPv6 address or an Internet host name. Return Value: T 2 min read C# | Uri.EscapeDataString(String) Method Uri.EscapeDataString(String) Method is used to convert a string to its escaped representation. Syntax: public static string EscapeDataString (string stringToEscape); Here, it takes the string to escape. Return Value: This method returns a string which contains the escaped representation of stringToE 3 min read C# | Uri.ToString() Method Uri.ToString( ) Method is used to get a canonical string representation for the specified Uri instance. Syntax: public override string ToString (); Return Value: This method returns a String instance that contains the unescaped canonical representation of the Uri instance. All characters are unescap 2 min read C# | Equals(String, String) Method In C#, Equals(String, String) is a String method. It is used to determine whether two String objects have the same value or not. Basically, it checks for equality. If both strings have the same value, it returns true otherwise returns false. This method is different from Compare and CompareTo method 2 min read C# | Uri.HexEscape(Char) Method Uri.HexEscape(Char) Method is used to convert a specified character into its hexadecimal equivalent. Syntax: public static string HexEscape (char character); Here, it takes the character to convert to hexadecimal representation. Return Value: This method returns the hexadecimal representation of the 1 min read C# | Uri.IsBaseOf(Uri) Method Uri.IsBaseOf(Uri) Method is used to determine whether the current Uri instance is a base of the specified Uri instance. Syntax: public bool IsBaseOf (Uri uri); Here, it takes the specified Uri instance to test.Return Value: This method returns true if the current Uri instance is a base of uri otherw 2 min read Like