The following sections describe solutions to the preceding problems. You can download the example solutions to see additional details and to experiment with the programs at https://github.com/PacktPublishing/The-Modern-CSharp-Challenge/tree/master/Chapter06.
Solutions
64. Removing blank lines
The following RemoveBlankLines method removes the blank lines from a file:
// Remove the empty lines from the indicated file.
private void RemoveBlankLines(string filename, out int numBlankLines,
out int numNonBlankLines)
{
// Read the file.
string[] lines = File.ReadAllLines(filename);
int totalLines = lines.Length;
// Remove blank lines.
List<string> nonblankLines = new List<string>();
foreach (string...