From 9507a8570ed0430241a75a2bf1bc7e69472b123d Mon Sep 17 00:00:00 2001 From: Yuri Vanin Date: Wed, 21 Jun 2017 21:57:25 -0700 Subject: [PATCH] Add String.Contains overload with StringComparison (dotnet/coreclr#12400) Staging change of System.Private.CoreLib for CoreFX dotnet/coreclr#20846 Commit migrated from https://github.com/dotnet/coreclr/commit/e1ceca5f5099761f9bc3be17fbc5cbd3e2b72ec4 --- src/coreclr/src/mscorlib/src/System/String.Searching.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coreclr/src/mscorlib/src/System/String.Searching.cs b/src/coreclr/src/mscorlib/src/System/String.Searching.cs index 411a45c1..388b5e1 100644 --- a/src/coreclr/src/mscorlib/src/System/String.Searching.cs +++ b/src/coreclr/src/mscorlib/src/System/String.Searching.cs @@ -16,6 +16,12 @@ namespace System return (IndexOf(value, StringComparison.Ordinal) >= 0); } + [Pure] + public bool Contains(string value, StringComparison comparisonType) + { + return (IndexOf(value, comparisonType) >= 0); + } + // Returns the index of the first occurrence of a specified character in the current instance. // The search starts at startIndex and runs thorough the next count characters. // -- 2.7.4