<p>I have a type (System.Type) of an enum and a string containing enumeration value to set.</p>

<p>E.g. given: </p>

<pre><code>enum MyEnum { A, B, C };
</code></pre>

<p>I have typeof(MyEnum) and "B".</p>

<p>How do I create MyEnum object set to MyEnum.B?</p>

```
```
MyEnum enumValue = (MyEnum)Enum.Parse(typeof(MyEnum), "B");
```
```
You also have a case-insensitive overload.