Error!
Success!

Enum TryParse Extension Method

0
kicks

Enum TryParse Extension Method  (Unpublished)

TryParse method is very helpful if you need to convert string representation of a value to a value itself. TryParse is better than Parse method because it doesn’t throw any exceptions and just returns a Boolean value to indicate weather the parsing was successful. Surprisingly there is no TryParse method available to use for Enum and this is where extension method can be extremely useful.


Kicked By:
Drop Kicked By: