C# Uri CheckSchemeName
Description
Uri CheckSchemeName
determines whether the specified
scheme name is valid.
Syntax
Uri.CheckSchemeName
has the following syntax.
public static bool CheckSchemeName(
string schemeName
)
Parameters
Uri.CheckSchemeName
has the following parameters.
schemeName
- The scheme name to validate.
Returns
Uri.CheckSchemeName
method returns A Boolean value that is true if the scheme name is valid; otherwise, false.
Example
The following example creates a Uri instance and checks whether the scheme name is valid.
using System;/*from w w w . j a va2 s . co m*/
public class MainClass{
public static void Main(String[] argv){
Uri address1 = new Uri("http://www.java2s.com/index.htm#search");
Console.WriteLine(Uri.CheckSchemeName(address1.Scheme));
}
}
The code above generates the following result.