I was looking for how to enter several variables into one line at once in C #, so I came across this code:
string t = ""; Console.WriteLine("Введите координаты точки (через пробел):"); t = Console.ReadLine(); string[] tv = t.Split(' ').Where(x => x != "").ToArray(); /*Тут происходит билиберда, которую я не понимаю, особенно зачем нужно Where и что внутри */ int AX = int.Parse(tv[0]); int AY = int.Parse(tv[1]); And everything seems to be clear, except for 4 lines, you can comment on what is happening in it, thanks in advance. Ps everything works so
Splitsecond parameter is to pass StringSplitOptions.RemoveEmptyEntries there will be no need for.Where(x => x != "").ToArray()- Grundy