title: Casting string to enum
body: <p>I'm reading file content and take string at exact location like this</p>
  
  <pre><code> string fileContentMessage = File.ReadAllText(filename).Substring(411, 3);
  </code></pre>
  
  <p>Output will always be either <code>Ok</code> or <code>Err</code></p>
  
  <p>On the other side I have <code>MyObject</code> which have <code>ContentEnum</code> like this</p>
  
  <pre><code>public class MyObject
  
      {
        public enum ContentEnum { Ok = 1, Err = 2 };        
        public ContentEnum Content { get; set; }
      }
  </code></pre>
  
  <p>Now, on the client side I want to use code like this (to cast my string <code>fileContentMessage</code> to <code>Content</code> property)</p>
  
  <pre><code>string fileContentMessage = File.ReadAllText(filename).Substring(411, 3);
  
      MyObject myObj = new MyObject ()
      {
         Content = /// ///,
      };
  </code></pre>