title: Decode Large base64 text string in C#
body: <p>I have Large base64 encoded text file I need to know  in C#.Net</p>
  
  <p>How do I decode this large string into a string?</p>
  
  <p>I use this Code but it take long time, and sometimes it got frozen and stop responding</p>
  
  <pre><code>richTextBox2.Text = Base64Decode(richTextBox1.Text); // I Past text at richTextBox1
  </code></pre>
  
  <p>and I try this too</p>
  
  <pre><code>var bytes = Convert.FromBase64String(richTextBox1.Text);
  var text = System.Text.Encoding.Unicode.GetString(bytes, 0, bytes.Length);
  richTextBox2.Text = text.ToString();
  </code></pre>
  
  <p>there are many similar Questions but I find no one talk about large text files</p>
  
  <p>Edit:</p>
  
  <pre><code>public static string Base64Decode(string base64EncodedData)
      {
          var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
          return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
      }
  </code></pre>