From b24f080b2ab1851d446ffb87ca3b31e165757531 Mon Sep 17 00:00:00 2001 From: PM Extra Date: Fri, 18 Dec 2020 18:19:55 +0800 Subject: [PATCH] Fix AbpStringExtensions For now, `"".RemovePreFix("x")` will return null. It's not a expected result. I think we shouldn't make empty string be null when trim prefix or postfix. --- framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs b/framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs index 6aa3deb4f0..76ae06a5e0 100644 --- a/framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs +++ b/framework/src/Volo.Abp.Core/System/AbpStringExtensions.cs @@ -133,7 +133,7 @@ namespace System { if (str.IsNullOrEmpty()) { - return null; + return str; } if (postFixes.IsNullOrEmpty()) @@ -174,7 +174,7 @@ namespace System { if (str.IsNullOrEmpty()) { - return null; + return str; } if (preFixes.IsNullOrEmpty())