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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version