/// <summary> /// Reads the entire file and returns the contents as a string enumberable, with each item representing a different line. /// </summary> /// <param name="file">The file.</param> /// <returns>A string enumberable representing the contents of the file.</returns> public static IEnumerable<string> ReadLines(AFile file) { Exceptions.NotNullException<AFile>(file, nameof(file)); return file.ReadAllLines(); }
/// <summary> /// Reads the entire file and returns the contents as a string list, with each item representing a different line. /// </summary> /// <param name="file">The file.</param> /// <returns>A string list representing the contents of the file.</returns> public static List<string> ReadLinesList(AFile file) { Exceptions.NotNullException<AFile>(file, nameof(file)); return new List<string>(file.ReadAllLines()); }
/// <summary> /// Reads the entire file and returns the contents as a string array, with each item representing a different line. /// </summary> /// <param name="file">The file.</param> /// <returns>A string array representing the contents of the file.</returns> public static string[] ReadAllLines(AFile file) { Exceptions.NotNullException<AFile>(file, nameof(file)); return file.ReadAllLines(); }