fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. List<string> emails = new List<string>();
  10. emails.Add("fullname@example.com");
  11. emails.Add("first_last@example.com");
  12. emails.Add("first.last@example.com");
  13. emails.Add("first.middle.last@test.com");
  14. emails.Add("first.last(comment)@example.com");
  15. Func<string, bool> dotBeforeAt = delegate(string email)
  16. {
  17. var dotIndex = email.IndexOf(".");
  18. return dotIndex > -1 && (dotIndex < email.IndexOf("@"));
  19. };
  20.  
  21. foreach(var email in emails.Where(dotBeforeAt)) {
  22. Console.WriteLine(email);
  23. }
  24. }
  25. }
Success #stdin #stdout 0.06s 24536KB
stdin
Standard input is empty
stdout
first.last@example.com
first.middle.last@test.com
first.last(comment)@example.com