title: C# read line from string
body: <p>How can I read all line from string.</p>
  
  <p>My code that I have tested(Not working)</p>
  
  <pre><code>string line;
  line = mycontent;
  StreamReader streamReader = new StreamReader(line);
  string data = streamReader.ReadToEnd();
  MessageBox.Show(data);
  </code></pre>
  
  <p>This code is showing error.
  I want to create a simple program that can ReadToEnd from a string not from a file path. I have learned that StreamReader can be used for read a file from file path.</p>
  
  <p>My intention is like i have a <code>string mycontent = "Simple"</code> and I want to read this <code>mycontent</code> to the end. But the <code>mycontent</code> is changing every times did I press a button. <code>So I want to create something that similar to this code.</code></p>
  
  <p>Thank you.</p>
  
  <p>PS. The error says <code>'Illegal characters in path.'</code></p>