Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace _31_03_CameraView
- {
- class CameraView
- {
- static void Main(string[] args)
- {
- var firstLine = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- var skip = firstLine[0]+2;
- var take = firstLine[1];
- List<string> result = new List<string>();
- var line = Console.ReadLine();
- var pattern = new Regex(@"\|<[\w]+");
- var matchedWords = pattern.Matches(line).Cast<Match>().Select(x => x.Value.ToString()).ToArray();
- foreach (var word in matchedWords)
- {
- // var modifiedWord = word.Skip(skip).Take(take).ToString();
- Console.Write("{0}", word.Skip(skip));
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment