调整进入getKeyData的判断条件

This commit is contained in:
DEVICE8\12494
2023-04-07 17:13:11 +08:00
parent 9d85cceab6
commit adba94e833
3 changed files with 354 additions and 319 deletions

View File

@@ -824,6 +824,22 @@ public static class StringExtensions
return char.ToUpper(str[0]) + str.Substring(1, str.Length - 1);
}
/// <summary>
/// Span实现首字符大写
/// added by ly on 20230407
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static string FirstCharToUpperAsSpan(this string input)
{
if (string.IsNullOrEmpty(input))
{
return string.Empty;
}
Span<char> destination = stackalloc char[1];
input.AsSpan(0, 1).ToUpperInvariant(destination);
return $"{destination}{input.AsSpan(1)}";
}
/// <summary>
/// 计算当前字符串与指定字符串的编辑距离(相似度).