C# Guid Inequality

Description

Guid Inequality indicates whether the values of two specified Guid objects are not equal.

Syntax

Guid.Inequality has the following syntax.


public static bool operator !=(
  Guid a,
  Guid b
)

Parameters

Guid.Inequality has the following parameters.

  • a - The first object to compare.
  • b - The second object to compare.

Returns

Guid.Inequality method returns true if a and b are not equal; otherwise, false.

Example

Indicates whether the values of two specified Guid objects are not equal.


/*from   w  w w .  j  a  v a2s . co  m*/
using System;

public class Example
{
   public static void Main()
   {
      // Create a GUID and determine whether it consists of all zeros.
      Guid guid1 = Guid.NewGuid();
      Console.WriteLine(guid1);
      Console.WriteLine("Empty: {0}\n", guid1 != Guid.Empty);

   }
}

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