From d0845536007a68c38512f048c2a8b34e7a9400fa Mon Sep 17 00:00:00 2001 From: Jack Kanarish Date: Thu, 1 Nov 2018 17:28:27 -0400 Subject: [PATCH] fix: fix an issue where use of except causes phone numbers with repeat digits to be improperly truncated --- ICD.Common.Utils/Extensions/StringExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ICD.Common.Utils/Extensions/StringExtensions.cs b/ICD.Common.Utils/Extensions/StringExtensions.cs index 0496bb3..6034ae0 100644 --- a/ICD.Common.Utils/Extensions/StringExtensions.cs +++ b/ICD.Common.Utils/Extensions/StringExtensions.cs @@ -162,8 +162,9 @@ namespace ICD.Common.Utils.Extensions if (characters == null) throw new ArgumentNullException("characters"); + var cSet = characters.ToIcdHashSet(); - return new string(extends.Except(characters).ToArray()); + return new string(extends.Where(c => !cSet.Contains(c)).ToArray()); } ///