Enum.TryParse (.NET 4.0)





4.00/5 (13 votes)
Since .NET 4.0, the Enum class contains also a TryParse method. The TryParse method, which is supported in other basic data types already since version 2.0, allows to pass in a value which will be checked if it can be converted into the defined type.