ucasesoftware,
I would normally use the method Herfried suggests:
Try
Dim g As New Guid(<string>)
Catch ex As FormatException
...
End Try
I was going to suggest TryParse with VB 2005, however I don't see it listed
for Guid, just the "numeric" types (Integer, Long, Single, Double, Decimal,
DateTime...) possibly because Guid doesn't have a Parse function...
If I considered the RegEx approach as Ken suggests, I would be certain to
take into account all 5 formats that a GUID could be in:
http://msdn.microsoft.com/library/de...ctorTopic2.asp
Ergo I suspect the Try/Catch would be "easier" in the long run, although the
RegEx approach might be "Better" for dialog boxes...
--
Hope this helps
Jay
T.S. Bradley -
http://www.tsbradley.net
"ucasesoftware" <uc***********@hotmail.fr> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
| How to know if a string is a guid
|
| thx
|