Skip to content

Commit 7a81815

Browse files
Cleanup and simplification.
1 parent c9a0562 commit 7a81815

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Source/.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ dotnet_diagnostic.CA1303.severity = silent
55

66
# CA1707: Identifiers should not contain underscores
77
dotnet_diagnostic.CA1707.severity = silent
8+
9+
# IDE0057: Use range operator
10+
dotnet_diagnostic.IDE0057.severity = silent

Source/Open.Text.csproj

Lines changed: 1 addition & 0 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 useful classes for working with strings and formatting values.

Source/Text.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static partial class Extensions
2020
private const uint BYTE_RED = 1024;
2121
private static readonly string[] _byte_labels = new[] { "KB", "MB", "GB", "TB", "PB" };
2222
private static readonly string[] _number_labels = new[] { "K", "M", "B" };
23-
public static readonly Regex VALID_ALPHA_NUMERIC_ONLY = new Regex(@"^\w+$");
23+
public static readonly Regex VALID_ALPHA_NUMERIC_ONLY = new(@"^\w+$");
2424

2525
/// <summary>
2626
/// Finds the first instance of a character and returns the set of characters up to that sequence.
@@ -576,7 +576,7 @@ public static string ToMetricString(this int number, string decimalFormat = "N1"
576576
=> ToMetricString((double)number, decimalFormat, cultureInfo);
577577
#endregion
578578

579-
public static readonly Regex WHITESPACE = new Regex(@"\s+");
579+
public static readonly Regex WHITESPACE = new(@"\s+");
580580

581581
/// <summary>
582582
/// Replaces any white-space with the specified string.

0 commit comments

Comments
 (0)