Search code examples
c#file.netfile.readalllines

What is the difference between File.ReadAllLines() and File.ReadAllText()?


What is the difference between File.ReadAllLines() and File.ReadAllText()?


Solution

  • ReadAllLines returns an array of strings. Each string contains a single line of the file.

    ReadAllText returns a single string containing all the lines of the file.