sivancheva

CameraView

Sep 11th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace _31_03_CameraView
  9. {
  10. class CameraView
  11. {
  12. static void Main(string[] args)
  13. {
  14.  
  15. var firstLine = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  16. var skip = firstLine[0]+2;
  17. var take = firstLine[1];
  18.  
  19. List<string> result = new List<string>();
  20.  
  21. var line = Console.ReadLine();
  22. var pattern = new Regex(@"\|<[\w]+");
  23.  
  24. var matchedWords = pattern.Matches(line).Cast<Match>().Select(x => x.Value.ToString()).ToArray();
  25.  
  26.  
  27. foreach (var word in matchedWords)
  28. {
  29. // var modifiedWord = word.Skip(skip).Take(take).ToString();
  30.  
  31. Console.Write("{0}", word.Skip(skip));
  32. }
  33. Console.WriteLine();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment