Enum TryParse Extension Method(objectreference.net)
submitted by
Vort3X(1335) 3 years, 9 months ago
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.
|category: C#
|Views: 272
tags:
C# another
Everyones tags:
Your Tags: