Represents a globally unique identifier (GUID).

Hierarchy (view full)

Constructors

  • Initializes a new instance of the System.Guid structure by using the value represented by the specified string.

    Parameters

    • g: string | String

      A string that contains a GUID in one of the following formats ("d" represents a hexadecimal digit whose case is ignored): 32 contiguous digits: dddddddddddddddddddddddddddddddd -or- Groups of 8, 4, 4, 4, and 12 digits with hyphens between the groups. The entire GUID can optionally be enclosed in matching braces or parentheses: dddddddd-dddd-dddd-dddd-dddddddddddd -or- {dddddddd-dddd-dddd-dddd-dddddddddddd} -or- (dddddddd-dddd-dddd-dddd-dddddddddddd) -or- Groups of 8, 4, and 4 digits, and a subset of eight groups of 2 digits, with each group prefixed by "0x" or "0X", and separated by commas. The entire GUID, as well as the subset, is enclosed in matching braces: {0xdddddddd, 0xdddd, 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}} All braces, commas, and "0x" prefixes are required. All embedded spaces are ignored. All leading zeros in a group are ignored. The digits shown in a group are the maximum number of meaningful digits that can appear in that group. You can specify from 1 to the number of digits shown for a group. The specified digits are assumed to be the low-order digits of the group.

    Returns Guid

Properties

Empty: Guid

A read-only instance of the System.Guid structure whose value is all zeros.

Methods

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Determines whether the specified object is equal to the current object.

    Parameters

    • obj: any

      The object to compare with the current object.

    Returns boolean

    true if the specified object is equal to the current object; otherwise, false.

  • Serves as the default hash function.

    Returns number

    A hash code for the current object.

  • Returns a string representation of the value of this instance in registry format.

    Returns string

    The value of this System.Guid, formatted by using the "D" format specifier as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where the value of the GUID is represented as a series of lowercase hexadecimal digits in groups of 8, 4, 4, 4, and 12 digits and separated by hyphens. An example of a return value is "382c74c3-721d-4f34-80e5-57657b6cbc27". To convert the hexadecimal digits from a through f to uppercase, call the System.String.ToUpper method on the returned string.

  • Returns a string that represents the current object.

    Returns string

    A string that represents the current object.

  • Returns a string representation of the value of this System.Guid instance, according to the provided format specifier.

    Parameters

    • format: string | String

      A single format specifier that indicates how to format the value of this System.Guid. The format parameter can be "N", "D", "B", "P", or "X". If format is null or an empty string (""), "D" is used.

    Returns string

    The value of this System.Guid, represented as a series of lowercase hexadecimal digits in the specified format.

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1

  • Determines whether the specified object instances are considered equal.

    Parameters

    • objA: any

      The first object to compare.

    • objB: any

      The second object to compare.

    Returns boolean

    true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.

  • Initializes a new instance of the System.Guid structure.

    Returns Guid

    A new GUID object.

  • Converts the string representation of a GUID to the equivalent System.Guid structure.

    Parameters

    • input: string | String

      The string to convert.

    Returns Guid

    A structure that contains the value that was parsed.

  • Converts the string representation of a GUID to the equivalent System.Guid structure.

    Parameters

    • input: string | String

      The GUID to convert.

    • result: OutParam<Guid>

      The structure that will contain the parsed value. If the method returns true, result contains a valid System.Guid. If the method returns false, result equals System.Guid.Empty.

    Returns boolean

    true if the parse operation was successful; otherwise, false.