Skip to content

Commit

Permalink
Use NETSTANDARD2_0 as needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejball committed Nov 14, 2024
1 parent 21a8b5c commit d771193
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Facility.Definition/CodeGen/CodeGenUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class CodeGenUtility
/// <summary>
/// Capitalizes the specified string.
/// </summary>
#if NET6_0_OR_GREATER
#if !NETSTANDARD2_0
public static string Capitalize(string value) => value.Length == 0 ? value : string.Concat(value[..1].ToUpperInvariant(), value.AsSpan(1));
#else
public static string Capitalize(string value) => value.Length == 0 ? value : value.Substring(0, 1).ToUpperInvariant() + value.Substring(1);
Expand All @@ -24,7 +24,7 @@ public static class CodeGenUtility
/// <summary>
/// Uncapitalizes the specified string.
/// </summary>
#if NET6_0_OR_GREATER
#if !NETSTANDARD2_0
public static string Uncapitalize(string value) => value.Length == 0 ? value : string.Concat(value[..1].ToLowerInvariant(), value.AsSpan(1));
#else
public static string Uncapitalize(string value) => value.Length == 0 ? value : value.Substring(0, 1).ToLowerInvariant() + value.Substring(1);
Expand Down
2 changes: 1 addition & 1 deletion src/Facility.Definition/Fsd/FsdParsers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static string DecodeBackslash(string text) =>
'n' => "\n",
'r' => "\r",
't' => "\t",
#if NET6_0_OR_GREATER
#if !NETSTANDARD2_0
'u' => new string((char) ushort.Parse(text.AsSpan(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture), 1),
#else
'u' => new string((char) ushort.Parse(text.Substring(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture), 1),
Expand Down
2 changes: 1 addition & 1 deletion src/Facility.Definition/Regexes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal static partial class Regexes
{
private const string c_wordPattern = "[A-Z]([A-Z]*(?![a-z])|[a-z]*)|[a-z]+|[0-9]+";
private const RegexOptions c_wordOptions = RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture;
#if NET7_0_OR_GREATER
#if !NETSTANDARD2_0
[GeneratedRegex(c_wordPattern, c_wordOptions)]
public static partial Regex Word();
#else
Expand Down
2 changes: 1 addition & 1 deletion src/Facility.Definition/ServiceDefinitionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal static ServiceDefinitionError CreateInvalidAttributeValueError(string a

internal static IReadOnlyList<T> ToReadOnlyList<T>(this IEnumerable<T>? items) => new ReadOnlyCollection<T>((items ?? []).ToList());

#if NET6_0_OR_GREATER
#if !NETSTANDARD2_0
internal static bool ContainsOrdinal(this string text, string value) => text.Contains(value, StringComparison.Ordinal);
internal static string ReplaceOrdinal(this string text, string oldValue, string newValue) => text.Replace(oldValue, newValue, StringComparison.Ordinal);
#else
Expand Down

0 comments on commit d771193

Please sign in to comment.