From ea8e34bace36d92f35a46e866918bb6cae690dd9 Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Thu, 7 May 2026 12:04:31 -0700 Subject: [PATCH] Replace StringExtensions with Meziantou.Polyfills --- .../Microsoft.Dynamic.csproj | 2 ++ .../Microsoft.Dynamic/StringExtensions.cs | 24 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 src/core/Microsoft.Dynamic/StringExtensions.cs diff --git a/src/core/Microsoft.Dynamic/Microsoft.Dynamic.csproj b/src/core/Microsoft.Dynamic/Microsoft.Dynamic.csproj index cbe94451..99251395 100644 --- a/src/core/Microsoft.Dynamic/Microsoft.Dynamic.csproj +++ b/src/core/Microsoft.Dynamic/Microsoft.Dynamic.csproj @@ -10,6 +10,8 @@ P:System.Collections.ObjectModel.ReadOnlyCollection`1.Empty; P:System.Collections.ObjectModel.ReadOnlyDictionary`2.Empty; + M:System.String.IndexOf(System.Char,System.StringComparison); + M:System.String.StartsWith(System.Char); diff --git a/src/core/Microsoft.Dynamic/StringExtensions.cs b/src/core/Microsoft.Dynamic/StringExtensions.cs deleted file mode 100644 index a1963924..00000000 --- a/src/core/Microsoft.Dynamic/StringExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Microsoft.Scripting -{ - internal static class StringExtensions - { -#if !NETCOREAPP - public static bool EndsWith(this string str, char value) - { - return str.EndsWith(value.ToString(), StringComparison.Ordinal); - } - - public static bool StartsWith(this string str, char value) - { - return str.StartsWith(value.ToString(), StringComparison.Ordinal); - } - - public static int IndexOf(this string str, char value, StringComparison comparisonType) { - if (comparisonType == StringComparison.Ordinal) return str.IndexOf(value); - return str.IndexOf(value.ToString(), comparisonType); - } -#endif - } -}