Skip to content

Commit

Permalink
Use expression body definition
Browse files Browse the repository at this point in the history
  • Loading branch information
josepho0918 committed May 31, 2024
1 parent 6571090 commit 455b247
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions TrimTail/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ public class Program
{
private static readonly SemaphoreSlim sem = new(1);

public static bool HasTrailingBlanks(in string filePath)
{
return File.ReadLines(filePath).Any(line => !string.IsNullOrEmpty(line) && char.IsWhiteSpace(line[^1]));
}
public static bool HasTrailingBlanks(in string filePath) =>
File.ReadLines(filePath).Any(line => !string.IsNullOrEmpty(line) && char.IsWhiteSpace(line[^1]));

public static void RemoveTrailingBlanks(in string filePath)
{
Expand Down

0 comments on commit 455b247

Please sign in to comment.