fork download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = @"1. message: this is some message 2. message: this is some message 3. message: this is message which i want to see only in results";
  10.  
  11. foreach (var message in Regex.Split(str, @"\d+\. message: ")
  12. .GroupBy(m => m)
  13. .Where(m => m.Count() == 1 && m.Key != string.Empty)
  14. .Select(m => new { message = m.Key }))
  15. {
  16.  
  17. Console.WriteLine(message.message);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.08s 34256KB
stdin
Standard input is empty
stdout
this is message which i want to see only in results