views:

764

answers:

1

why doesn't this work?

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

+11  A: 

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

MsgBox("F6D8C47B-46E6-4E93-A393-00085ACA2242".Replace("-",""))
Brandon
or MsgBox(new Guid("F6D8C47B-46E6-4E93-A393-00085ACA2242").ToString().Replace("-", ""))
Allen
Why convert it to a Guid only to convert it back to a string?
Brandon
I think the literal string was just for explanitory purposes, it is probably a string variable in the real code.
JohnFx
Ah, maybe I'm misunderstanding something, apologies if I am, but even if it is a string variable, why make it a Guid in the first place?
Brandon