08 December, 2013

Generating GUID without hyphen C#

You can use the "N" specifier with the Guid.ToString(String) overload.

Guid.NewGuid().ToString("N");
32 digits:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
By default letters are lowercase. A Guid with only uppercase letters can only be achieved by manually converting them all to uppercase, example:
Guid.NewGuid().ToString("N").ToUpper();