fork download
  1. using System;
  2.  
  3. namespace ImgurLinkConverter
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. //Console.Write("Input imgur link: ");
  10. //string link = Console.ReadLine();
  11. //Console.Write(ConvertLink(link));
  12. Console.Write(ConvertLink());
  13. Console.ReadKey();
  14. }
  15.  
  16. private static string ConvertLink(string link)
  17. {
  18. if (
  19. !link.Contains("/a/") &&
  20. link.Contains("https://i...content-available-to-author-only...r.com/")
  21. )
  22. {
  23. link = link.Insert(8, "i.");
  24. return link + ".png";
  25. }
  26. return "Invalid link";
  27. }
  28.  
  29. private static string ConvertLink()
  30. {
  31. string link = "https://i...content-available-to-author-only...r.com/imSB81I";
  32. return ConvertLink(link);
  33. }
  34. }
  35. }
Success #stdin #stdout 0.02s 14800KB
stdin
Standard input is empty
stdout
https://i...content-available-to-author-only...r.com/imSB81I.png