Saif Khan
Saif Khan

Reputation: 18812

Converting GUID to String

why doesn't this work?

MsgBox("F6D8C47B-46E6-4E93-A393-00085ACA2242").ToString.Replace("-", "")

Upvotes: 0

Views: 1414

Answers (2)

tender
tender

Reputation: 1

MsgBox(Guid.NewGuid().ToString("N").ToUpper());

Upvotes: 0

Brandon
Brandon

Reputation: 70022

You're calling ToString on the MsgBox, not the Guid, which apparently is already a string. Try

MsgBox("F6D8C47B-46E6-4E93-A393-00085ACA2242".Replace("-",""))

Upvotes: 11

Related Questions