Code Review 2

This commit is contained in:
龙腾猫跃 committed 2026-05-07 09:20:23 +08:00
1 parent 9158a69b62
commit 368280fcb5
8 files changed
+54 -45

No files matched your search

+1 -1
View File
@@ -189,7 +189,7 @@ public static class StringExtensions {
/// 过短则用 <paramref name="code"/> 将其左侧填充,过长则截取靠左的指定长度。
/// </summary>
public static string EnsureLength(this string? str, char code, int length) {
if (str == null) str = "";
str ??= "";
return str.Length > length ? str.Substring(0, length) : str.PadLeft(length, code);
}