fork download
  1. using System.IO;
  2. using System;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var texto = "meu texto aqui";
  7. var stream = new MemoryStream();
  8. StreamWriter writer = new StreamWriter(stream);
  9. writer.Write(texto);
  10. writer.Flush();
  11. stream.Position = 0;
  12. var reader = new StreamReader(stream);
  13. var novotexto = reader.ReadToEnd();
  14. Console.WriteLine(novotexto);
  15. }
  16. }
  17.  
  18. //http://pt.stackoverflow.com/q/186048/101
Success #stdin #stdout 0.02s 15752KB
stdin
Standard input is empty
stdout
meu texto aqui