ParseEnum<T> Guid?, string

.ParseEnum<T>()

Converts a string into an enum value of the given type.

Method

public static T ParseEnum<T>(this string s)
string s

A string containing an enum text value to convert to an actual enum of the passed in type.

Example

C#
enum Days = { Sun, Mon, Tue, Wed, Thur, Fri, Sat };
Days d = "Mon".ParseEnum<Days>()