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 19:05:24 GMT+0000 (Coordinated Universal Time)

Saved by @hiso #cs

  using System.Linq;

  ...

  int[] y = File
    .ReadAllText(@"F:/C#/graph/graph/bin/Debug/y.txt")
    .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
    .Select(item => int.Parse(item))
    .ToArray();

  string[] x = File
    .ReadAllText(@"F:/C#/graph/graph/bin/Debug/x.txt")
    .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
    .ToArray();
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