mirror of
https://github.com/parnic/advent-of-code-2023.git
synced 2025-06-16 16:50:14 -05:00
Fix ReadAllText
I guess I've either never used this or only used it for one-line files because it was only ever returning the last line of the file.
This commit is contained in:
@ -72,9 +72,9 @@ public static class Parsing
|
||||
|
||||
internal static string ReadAllText(string filename)
|
||||
{
|
||||
string contents = string.Empty;
|
||||
ReadData(filename, (line) => contents = line);
|
||||
return contents;
|
||||
StringBuilder sb = new();
|
||||
ReadData(filename, (line) => sb.AppendLine(line));
|
||||
return sb.ToString().Trim();
|
||||
}
|
||||
|
||||
internal static IEnumerable<string> ReadAllLines(string filename)
|
||||
|
Reference in New Issue
Block a user