Is there a GUID.TryParse() in .NET 3.5?

后端 未结 7 1519
遇见更好的自我
遇见更好的自我 2021-01-07 16:25

UPDATE

Guid.TryParse is available in .NET 4.0

END UPDATE

Obviously there is no public GUID.TryParse() in .NET CLR

7条回答
  •  失恋的感觉
    2021-01-07 16:43

    There's no TryParse functionality in the .NET Framework to my knowledge at this moment. You'll have to resort to RegEx or the try-catch option. RegEx isn't my cup of tea, so I'm sure someone else will post an answer.

    Exceptions are expensive performance wise, so my vote goes to the RegEx option.

提交回复
热议问题