Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Uri.CheckSchemeName(String) Method in C#
The Uri.CheckSchemeName() method in C# is used to determine whether the specified scheme name is valid.
syntax
Following is the syntax −
public static bool CheckSchemeName (string schemeName);
Above, the parameter scheme name is the scheme name to validate.
Example
Let us now see an example to implement the Uri.CheckSchemeName() method −
using System;
public class Demo {
public static void Main(){
Uri newURI = new Uri("https://www.tutorialspoint.com");
Console.WriteLine("URI = "+newURI);
string schemeName = newURI.Scheme;
if(Uri.CheckSchemeName(schemeName))
Console.WriteLine("Valid: Scheme name");
else
Console.WriteLine("Invalid: Scheme name");
}
}
Output
This will produce the following output −
URI = https://www.tutorialspoint.com/ Valid: Scheme name
Example
Let us now see another example to implement the Uri.CheckSchemeName() method −
using System;
public class Demo {
public static void Main(){
Uri newURI = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI);
string schemeName = newURI.Scheme;
if(Uri.CheckSchemeName(schemeName))
Console.WriteLine("Valid: Scheme name");
else
Console.WriteLine("Invalid: Scheme name");
}
}
Output
This will produce the following output −
URI = https://www.tutorialspoint.com/index.htm Valid: Scheme name
Advertisements