Advertisement
Guest User

CensorEmail

a guest
Jun 6th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CensorYourEmail
  4. {
  5. class CensorYourEmail
  6. {
  7. static void Main(string[] args)
  8. {
  9. string[] email = Console.ReadLine().Split('@');
  10. string text = Console.ReadLine();
  11.  
  12. string username = email[0];
  13. string domain = "@" + email[1];
  14.  
  15. string whole = username + domain;
  16.  
  17. int userLen = username.Length;
  18. string ne = new string('*', userLen);
  19.  
  20. string replacement = ne + domain;
  21.  
  22. text = text.Replace(whole, replacement);
  23.  
  24. Console.WriteLine(text);
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement