Skip to content

Instantly share code, notes, and snippets.

@kkbruce
Created August 17, 2017 03:35
Show Gist options
  • Select an option

  • Save kkbruce/194ba6e1632be1ba0c4955e0ccbe669a to your computer and use it in GitHub Desktop.

Select an option

Save kkbruce/194ba6e1632be1ba0c4955e0ccbe669a to your computer and use it in GitHub Desktop.
List GUID string formats
// For LINQPad use
// 32 digits
// ex: 4af8654b1c8142c793f47f9f33c6e883
Guid.NewGuid().ToString("N").Dump("N");
// 32 digits separated by hyphens
// ex: d197f0ba-797f-49d2-bdf3-883486f29a31
Guid.NewGuid().ToString("D").Dump("D");
// 32 digits separated by hyphens, enclosed in braces
// ex: {084e6c10-de4c-49ff-b6fd-54c45fcacbfd}
Guid.NewGuid().ToString("B").Dump("B");
// 32 digits separated by hyphens, enclosed in parentheses
// ex: (48c5a44a-e7f5-4045-ae4f-6a1c8917bff9)
Guid.NewGuid().ToString("P").Dump("P");
// Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in brace
// ex: {0xeef5520c,0xa363,0x4c99,{0xbb,0x07,0x71,0xa8,0x18,0x37,0xc2,0x59}}
Guid.NewGuid().ToString("X").Dump("X");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment