Reputation: 3539
Something else that may be nice to know along with guids is how to set the format of the guid string
' plain with nothing added
Console.Writeline(System.Guid.NewGuid().ToString("N"))
'with delimeter (-)/default
Console.Writeline(System.Guid.NewGuid().ToString("D"))
'default with brackets
Console.Writeline(System.Guid.NewGuid().ToString("B"))
'default with paranthesis
Console.Writeline(System.Guid.NewGuid().ToString("P"))
Upvotes: 5
Reputation: 9335
System.Guid.NewGuid()
The complete doc is here: http://msdn.microsoft.com/en-us/library/system.guid.aspx
Upvotes: 23