local changes

This commit is contained in:
sharinganthief 2026-04-30 10:53:38 -04:00
parent 6898ead35d
commit 1c4dedd4f4
2 changed files with 20 additions and 5 deletions

View file

@ -30,22 +30,37 @@ public static object NullSafe(this object target)
public static string FirstCharToLower(this string input)
{
if (string.IsNullOrEmpty(input))
var firstChar = GetFirstCharOrHash(input);
if (string.IsNullOrEmpty(firstChar))
{
return string.Empty;
}
return char.ToLowerInvariant(input.First()) + input.Substring(1);
return string.Concat(firstChar.ToLowerInvariant(), input.AsSpan(1));
}
public static string FirstCharToUpper(this string input)
public static string GetFirstCharOrHash(string input)
{
if (string.IsNullOrEmpty(input))
{
return string.Empty;
}
return char.ToUpperInvariant(input.First()) + input.Substring(1);
var firstChar = input[0];
return char.IsDigit(firstChar) ? "#" : firstChar.ToString();
}
public static string FirstCharToUpper(this string input)
{
var firstChar = GetFirstCharOrHash(input);
if (string.IsNullOrEmpty(firstChar))
{
return string.Empty;
}
return string.Concat(firstChar.ToUpperInvariant(), input.AsSpan(1));
}
public static string Inject(this string format, params object[] formattingArgs)

View file

@ -6,7 +6,7 @@
<PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="Diacritical.Net" Version="1.0.4" />
<PackageReference Include="Equ" Version="2.3.0" />
<PackageReference Include="MailKit" Version="4.15.1" />
<PackageReference Include="MailKit" Version="4.16.0" />
<PackageReference Include="Polly" Version="8.6.4" />
<PackageReference Include="System.Text.Json" Version="10.0.5" />
<PackageReference Include="System.Memory" Version="4.6.3" />