c# - I want to replace the data in a text file with an array and store it in a variable - Stack Overflow

PHOTO EMBED

Wed Apr 27 2022 18:59:55 GMT+0000 (Coordinated Universal Time)

Saved by @hiso #cs

   using(System.IO.StreamReader sr = new System.IO.StreamReader("F:/C#/graph/graph/bin/Debug/x.txt"))
    {
        string line;
        while((line = sr.ReadLine()) != null)
        {
            string[] x = line.Split(' ');
        }
    }

   using(System.IO.StreamReader sr = new System.IO.StreamReader("F:/C#/graph/graph/bin/Debug/y.txt"))
    {
        string line;
        while((line = sr.ReadLine()) != null)
        {
            string[] yString = line.Split(' ');
        }
        int[] y = Array.ConvertAll(yString , s => int.Parse(s));

    }
content_copyCOPY

https://stackoverflow.com/questions/54461489/i-want-to-replace-the-data-in-a-text-file-with-an-array-and-store-it-in-a-variab