fork(2) download
  1. using System;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. string texto = @"From: .... blabla bla
  6. Message: blablabalab
  7. //linha em branco
  8.  
  9. From: .... blabla bla
  10. Message: blablabalab
  11.  
  12. //linha em Branco
  13.  
  14. From: .... blabla bla
  15. Message: blablabalab";
  16.  
  17. string[] pedacos = texto.Split(new string[] { "From: ", "Message: " }, StringSplitOptions.RemoveEmptyEntries);
  18. foreach (var pedaco in pedacos){
  19. Console.WriteLine(pedaco);
  20. }
  21. Console.ReadLine();
  22. }
  23. }
Success #stdin #stdout 0.03s 24152KB
stdin
Standard input is empty
stdout
.... blabla bla
		
blablabalab
		//linha em branco
		
		
.... blabla bla
		
blablabalab
		
		//linha em Branco
		
		
.... blabla bla
		
blablabalab