What is the difference between File.ReadAllLines() and File.ReadAllText() ?
File.ReadAllLines()
File.ReadAllText()
ReadAllLines returns an array of strings. Each line contains one line of the file.
ReadAllLines
ReadAllText returns a single line containing all lines of the file.
ReadAllText
File.ReadAllText () returns a single large string containing the entire contents of the file, while File.ReadAllLines () returns a string array of strings in the file.
Keep in mind that in the case of ReadAllText, "The received row does not contain the final carriage return and / or row feed."
More information is available in the notes section of the File.ReadAllText Method and File.ReadAllLines Method .
ReadAllText reads all this as a single string, ReadAllLines reads it as a StringArray .
StringArray