From: Yuri Vanin Date: Thu, 22 Jun 2017 04:57:25 +0000 (-0700) Subject: Add String.Contains overload with StringComparison (dotnet/coreclr#12400) X-Git-Tag: submit/tizen/20210909.063632~11030^2~6925^2~365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9507a8570ed0430241a75a2bf1bc7e69472b123d;p=platform%2Fupstream%2Fdotnet%2Fruntime.git 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 --- 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. //