Just when I generated a GUID, I found some hyphens in between the character and also at specified intervals


Is there any story behind this?

Note: My intention is to remove those hyphens as I am adding this GUID to a filename and our filename should only be aplhanumeric.

  • 1
    I think it's for readability. Although I must say it's a very strange placement of hyphens if that's the reason for them... – gablin Dec 25 '10 at 22:54
  • A GUID has several fields – JoelFan Feb 26 '15 at 22:15

The hyphens are always placed at the same position, so you won't lose any information (or unique-ness) by removing them.

See Stack Overflow: Why are there dashes in a .NET GUID? for a detailed explanation.

| improve this answer | |

Long sequences are very hard to parse for humans, hence the hyphens. But GUID itself is just a number, so you can drop them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.