There is a file with the text:
<координата x1> <координата y1> <координата x2> <координата y2> <координата x3> <координата y3> <координата x4> <координата y4> I need to split up all the unnecessary and leave only the numbers, BUT when downloading a file and outputting it to the console, it gives out a bunch of questions without understanding Russian letters. This is problem number one. Problem number 2: how to split off by cutting off the whole word without spelling it?
well, and the code itself, I'm new so do not swear and take notes to all listen properly
string text = File.ReadAllText("test.txt"); string[] coords = text.Split(' ', '\n', 'x', 'y', '<', '>', 'к', 'о', 'р', 'д', 'и', 'н', 'а', 'т'); int x1 = Convert.ToInt32(coords[0]); int y1 = Convert.ToInt32(coords[1]); int x2 = Convert.ToInt32(coords[2]); int y2 = Convert.ToInt32(coords[3]); int x3 = Convert.ToInt32(coords[4]); int y3 = Convert.ToInt32(coords[5]); int x4 = Convert.ToInt32(coords[6]); int y4 = Convert.ToInt32(coords[7]); Console.WriteLine("введите значение Х: "); int xP = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("введите значение Y: "); int yP = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(text + coords[1] +" "); Console.ReadLine();
RegEx? Choose numbers by sawing off another - Aleksey Shimansky