title: How to convert string to enum in c# with SelectToken
body: <p>Please refer to the below-given code snippet</p>
  <pre class="lang-cs prettyprint-override"><code>foreach (var invoiceDescription in qbInvoiceLineArray)
  {
      Line lineDescription = new Line();
      lineDescription.Description = Convert.ToString((string)invoiceDescription.SelectToken(QBConfig.InvoiceDescription));
      invoice.Line.Add(lineDescription);             
  } 
      
  public class QbInvoiceViewModel
  {
      public decimal Balance { get; set; }       
      public List&lt;LinkedTxn&gt; LinkedTxn { get; set; }
      public DateTime DueDate { get; set; }
      public DateTime TxnDate { get; set; }
      public Decimal TotalAmt { get; set; }
      public List&lt;Line&gt; Line { get; set; }    
  }
      
  public class Line
  {
      public string Description { get; set; }
      public LineDetailTypeEnum DetailType { get; set; }
  }
      
  public enum LineDetailTypeEnum
  {
      SalesItemLineDetail
  }
  </code></pre>
  <p>This line of code</p>
  <pre class="lang-cs prettyprint-override"><code>lineDescription.Description = Convert.ToString((string)invoiceDescription.SelectToken(QBConfig.InvoiceDescription));
  </code></pre>
  <p>can be used to convert string to string in c#. This type of code can be used to convert string to int also in c#. But how this type of code can be used to convert string to enum?</p>