Skip to content

Commit

Permalink
[ParsedFile.ReadAllGroupsOfLines] Make \r replacement safer by repl…
Browse files Browse the repository at this point in the history
…acing the whole \r\n group with \n.
  • Loading branch information
eduherminio committed Dec 6, 2020
1 parent acc61bc commit 27ec284
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FileParser/Implementations/ParsedFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public string ToSingleString(string wordSeparator = " ", string? lineSeparator =
public static List<List<string>> ReadAllGroupsOfLines(string path)
{
return File.ReadAllText(path)
.Replace("\r", "")
.Replace("\r\n", "\n")
.Split("\n\n")
.Where(str => !string.IsNullOrEmpty(str))
.Select(str => str.Split('\n', StringSplitOptions.RemoveEmptyEntries).ToList())
Expand Down

0 comments on commit 27ec284

Please sign in to comment.