IsGuid Method
Definition
IsGuid(string)
Determines whether the specified value has a valid format of a Guid.
public static bool IsGuid(string value)
Parameters
Returns
Remarks
This implementation only evaluates for GUID formats of: D | B | P, eg. 32 digits separated by hyphens; 32 digits separated by hyphens, enclosed in brackets and 32 digits separated by hyphens, enclosed in parentheses.
The reason not to include N, eg. 32 digits is the possible unintended GUID result of a MD5 string representation.
IsGuid(string, GuidFormats)
Determines whether the specified value has a valid format of a Guid.
public static bool IsGuid(string value, GuidFormats format)
Parameters
valuestringThe string to verify has a valid format of a Guid.
formatGuidFormatsA bitmask comprised of one or more GuidFormats that specify how the GUID parsing is conducted.