From 0f6ecc770305fa601d1fc95cd2c8eae5a873fddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Thu, 1 Feb 2024 14:32:08 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E6=AD=A3PinYin.GetFirst?= =?UTF-8?q?=E5=9C=A8=E6=9F=90=E4=BA=9B=E5=AD=97=E5=8F=96=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E6=8B=BC=E9=9F=B3=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84bug?= =?UTF-8?q?=E3=80=82=E8=AF=A5bug=E5=AF=BC=E8=87=B4XCode.Area=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=8A=A0=E8=BD=BD=EF=BC=8C=E6=9C=89=E4=B8=AA=E9=95=87?= =?UTF-8?q?=E7=9A=84=E5=90=8D=E5=AD=97=E5=85=B6=E4=B8=AD=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E6=97=A0=E6=B3=95=E8=BD=AC=E6=8B=BC=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NewLife.Core/Common/PinYin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewLife.Core/Common/PinYin.cs b/NewLife.Core/Common/PinYin.cs index f73682b62..c5eb877ce 100644 --- a/NewLife.Core/Common/PinYin.cs +++ b/NewLife.Core/Common/PinYin.cs @@ -540,7 +540,7 @@ public static String GetFirst(String str) if (str.IsNullOrEmpty()) return String.Empty; var rs = GetAll(str); - return rs.Select(e => e[0]).Join(""); + return rs.Where(e => !e.IsNullOrEmpty()).Select(e => e[0]).Join(""); } ///// 取各字符的拼音首字母