Skip to content

Commit 92b5bb5

Browse files
Cleanup and simplification.
1 parent f00709d commit 92b5bb5

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

CsvUtility.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Open.Text.CSV
99
public static class CsvUtility
1010
{
1111
public const string LINE_PATTERN = "((?:\")([^\"]+)(?:\")|([^,\"]+))(?:\\s*)(?:,|$)";
12-
public static readonly Regex LinePattern = new Regex(LINE_PATTERN);
12+
public static readonly Regex LinePattern = new(LINE_PATTERN);
1313

1414
public static IEnumerable<string> GetLine(string line)
1515
=> string.IsNullOrEmpty(line)
@@ -57,7 +57,7 @@ static IEnumerable<IEnumerable<string>> GetLinesCore(string csv)
5757
}
5858

5959
public const string NEWLINE = "\r\n";
60-
public static readonly Regex QUOTESNEEDED = new Regex("^\\s+|[,\n]|\\s+$");
60+
public static readonly Regex QUOTESNEEDED = new("^\\s+|[,\n]|\\s+$");
6161

6262
public static string WrapQuotes(string value)
6363
{

Open.Text.CSV.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<Nullable>enable</Nullable>
7+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
78
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
89
<Authors>electricessence</Authors>
910
<Description>A set of utilities for reading and writing CSV data.
@@ -48,10 +49,6 @@ Part of the "Open" set of libraries.
4849

4950
<ItemGroup>
5051
<PackageReference Include="Open.Text" Version="2.3.2" />
51-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
52-
<PrivateAssets>all</PrivateAssets>
53-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
54-
</PackageReference>
5552
</ItemGroup>
5653

5754
</Project>

0 commit comments

Comments
 (0)