diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig
index de0d6e8137e0b8..b4bf73bbcb23fe 100644
--- a/eng/CodeAnalysis.src.globalconfig
+++ b/eng/CodeAnalysis.src.globalconfig
@@ -475,7 +475,7 @@ dotnet_diagnostic.CA1860.severity = warning
 dotnet_diagnostic.CA1861.severity = warning
 
 # CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
-dotnet_diagnostic.CA1862.severity = warning
+dotnet_diagnostic.CA1862.severity = info
 
 # CA1863: Use 'CompositeFormat'
 dotnet_diagnostic.CA1863.severity = suggestion
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 06d9e1d4f9757b..00812b136ab3dc 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -367,13 +367,13 @@
       <Uri>https://github.com/dotnet/roslyn</Uri>
       <Sha>7829f6b85177e96de89bc67f32b61d74ac590f5a</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23364.2">
+    <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23405.1">
       <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
-      <Sha>45879f0b46557886b8d553d121a81866f67ce08a</Sha>
+      <Sha>633ade7a83c2b6918c10035247d93fbe1520463d</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23364.2">
+    <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23405.1">
       <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
-      <Sha>45879f0b46557886b8d553d121a81866f67ce08a</Sha>
+      <Sha>633ade7a83c2b6918c10035247d93fbe1520463d</Sha>
     </Dependency>
     <Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="8.0.100-preview.7.23329.3">
       <Uri>https://github.com/dotnet/sdk</Uri>
diff --git a/eng/Versions.props b/eng/Versions.props
index bc9bfb96e1f388..0786f2ee5bec7a 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -32,8 +32,8 @@
   </ItemGroup>
   <PropertyGroup>
     <!-- dotnet/roslyn-analyzers dependencies -->
-    <MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.23364.2</MicrosoftCodeAnalysisAnalyzersVersion>
-    <MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23364.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
+    <MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.23405.1</MicrosoftCodeAnalysisAnalyzersVersion>
+    <MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23405.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
     <!-- dotnet/roslyn dependencies -->
     <!--
       These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly.
diff --git a/src/coreclr/tools/Common/Compiler/ProcessLinkerXmlBase.cs b/src/coreclr/tools/Common/Compiler/ProcessLinkerXmlBase.cs
index abf7ac860c4d60..ba6b1f0694d048 100644
--- a/src/coreclr/tools/Common/Compiler/ProcessLinkerXmlBase.cs
+++ b/src/coreclr/tools/Common/Compiler/ProcessLinkerXmlBase.cs
@@ -211,7 +211,7 @@ protected virtual void ProcessTypes(ModuleDesc assembly, XPathNavigator nav, boo
 
                 string fullname = GetFullName(typeNav);
 
-                if (fullname.IndexOf("*") != -1)
+                if (fullname.Contains('*'))
                 {
                     if (ProcessTypePattern(fullname, assembly, typeNav))
                         continue;
diff --git a/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs b/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs
index 30342613be9acc..615d6017e37e37 100644
--- a/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs
+++ b/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs
@@ -271,7 +271,11 @@ private void Initialize(string? typeName, CodeTypeReferenceOptions options)
             }
 
             // Now see if we have some arity.  baseType could be null if this is an array type.
+#if NET5_0_OR_GREATER
+            if (_baseType != null && _baseType.Contains('`')) // string.Contains(char) is .NetCore2.1+ specific
+#else
             if (_baseType != null && _baseType.IndexOf('`') != -1) // string.Contains(char) is .NetCore2.1+ specific
+#endif
             {
                 _needsFixup = false;
             }
diff --git a/src/libraries/Common/src/System/Data/Common/MultipartIdentifier.cs b/src/libraries/Common/src/System/Data/Common/MultipartIdentifier.cs
index bca263e6eb0dad..0a116992976671 100644
--- a/src/libraries/Common/src/System/Data/Common/MultipartIdentifier.cs
+++ b/src/libraries/Common/src/System/Data/Common/MultipartIdentifier.cs
@@ -68,7 +68,7 @@ private static bool IsWhitespace(char ch)
                 throw ADP.InvalidMultipartNameToManyParts(property, name, limit);
             }
 
-            if (-1 != leftQuote.IndexOf(separator) || -1 != rightQuote.IndexOf(separator) || leftQuote.Length != rightQuote.Length)
+            if (leftQuote.Contains(separator) || rightQuote.Contains(separator) || leftQuote.Length != rightQuote.Length)
             {
                 throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
             }
@@ -111,7 +111,7 @@ private static bool IsWhitespace(char ch)
                                 state = MPIState.MPI_ParseQuote;
                             }
                             else
-                            if (-1 != rightQuote.IndexOf(testchar))
+                            if (rightQuote.Contains(testchar))
                             { // If we shouldn't see a right quote
                                 throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
                             }
@@ -133,12 +133,12 @@ private static bool IsWhitespace(char ch)
                                 state = MPIState.MPI_Value;
                             }
                             else // Quotes are not valid inside a non-quoted name
-                            if (-1 != rightQuote.IndexOf(testchar))
+                            if (rightQuote.Contains(testchar))
                             {
                                 throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
                             }
                             else
-                            if (-1 != leftQuote.IndexOf(testchar))
+                            if (leftQuote.Contains(testchar))
                             {
                                 throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
                             }
diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs
index 905dd855cd016a..db0a767573a1e8 100644
--- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs
+++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs
@@ -160,7 +160,11 @@ private IChangeToken GetOrAddChangeToken(string pattern)
             }
 
             IChangeToken changeToken;
+#if NET5_0_OR_GREATER
+            bool isWildCard = pattern.Contains('*');
+#else
             bool isWildCard = pattern.IndexOf('*') != -1;
+#endif
             if (isWildCard || IsDirectoryPath(pattern))
             {
                 changeToken = GetOrAddWildcardChangeToken(pattern);
diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.vb
index 9a2a6ae31c2842..45fe6e29b9a1ea 100644
--- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.vb
+++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.vb
@@ -2223,7 +2223,7 @@ Namespace Microsoft.VisualBasic.FileIO
 
                 ' If user wants to ignore case, convert new string to lower case. m_SearchText was converted in constructor.
                 If m_IgnoreCase Then
-                    Return New String(CharBuffer).ToUpper(CultureInfo.CurrentCulture).Contains(m_SearchText)
+                    Return New String(CharBuffer).Contains(m_SearchText, StringComparison.OrdinalIgnoreCase)
                 Else
                     Return New String(CharBuffer).Contains(m_SearchText)
                 End If
diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb
index 6cfdf1cb099447..39ef345c88c618 100644
--- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb
+++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb
@@ -241,11 +241,11 @@ Namespace Microsoft.VisualBasic
                 Return False
             End If
 
-            If (Path.IndexOf("*"c) <> -1) Then
+            If (Path.Contains("*"c)) Then
                 Return True
             End If
 
-            If (Path.IndexOf("?"c) <> -1) Then
+            If (Path.Contains("?"c)) Then
                 Return True
             End If
 
@@ -1315,7 +1315,7 @@ Namespace Microsoft.VisualBasic
         Friend Function VB6CheckPathname(ByVal oAssemblyData As AssemblyData, ByVal sPath As String, ByVal mode As OpenMode) As String
             Dim Result As String
             '  Error if wildcard characters in pathname
-            If (sPath.IndexOf("?"c) <> -1 OrElse sPath.IndexOf("*"c) <> -1) Then
+            If (sPath.Contains("?"c) OrElse sPath.Contains("*"c)) Then
                 Throw New ArgumentException(SR.Format(SR.Argument_InvalidPathChars1, sPath))
             End If
 
diff --git a/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs b/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
index 0e1ec989371662..095b76eb7deb53 100644
--- a/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
+++ b/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
@@ -181,8 +181,10 @@ private string QuoteSnippetString(string value)
             // If the string is short, use C style quoting (e.g "\r\n")
             // Also do it if it is too long to fit in one line
             // If the string contains '\0', verbatim style won't work.
+#pragma warning disable CA2249 // Consider using 'string.Contains' instead of 'string.IndexOf'
             if (value.Length < 256 || value.Length > 1500 || (value.IndexOf('\0') != -1)) // string.Contains(char) is .NetCore2.1+ specific
                 return QuoteSnippetStringCStyle(value);
+#pragma warning restore CA2249
 
             // Otherwise, use 'verbatim' style quoting (e.g. @"foo")
             return QuoteSnippetStringVerbatimStyle(value);
diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/PhoneAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/PhoneAttribute.cs
index 849eb26c8d2649..3ac7d71b3d4beb 100644
--- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/PhoneAttribute.cs
+++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/PhoneAttribute.cs
@@ -54,7 +54,7 @@ public override bool IsValid(object? value)
             {
                 if (!(char.IsDigit(c)
                     || char.IsWhiteSpace(c)
-                    || AdditionalPhoneNumberCharacters.IndexOf(c) != -1))
+                    || AdditionalPhoneNumberCharacters.Contains(c)))
                 {
                     return false;
                 }
diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
index 7463343674be06..436c9ed08b465f 100644
--- a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
+++ b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
@@ -2,7 +2,7 @@
   <PropertyGroup>
     <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
     <Nullable>disable</Nullable>
-    <NoWarn>$(NoWarn);nullable</NoWarn>
+    <NoWarn>$(NoWarn);CA2249;nullable</NoWarn>
     <!-- opt-out of trimming until it works https://github.com/dotnet/runtime/issues/49062 -->
     <IsTrimmable>false</IsTrimmable>
     <EnableAOTAnalyzer>false</EnableAOTAnalyzer>
diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DBCommandBuilder.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DBCommandBuilder.cs
index 5b744965e9eb65..387752c8e424b6 100644
--- a/src/libraries/System.Data.Common/src/System/Data/Common/DBCommandBuilder.cs
+++ b/src/libraries/System.Data.Common/src/System/Data/Common/DBCommandBuilder.cs
@@ -733,11 +733,11 @@ private void BuildInformation(DataTable schemaTable)
             string quotePrefix = QuotePrefix;
             string quoteSuffix = QuoteSuffix;
 
-            if (!string.IsNullOrEmpty(quotePrefix) && (-1 != baseTableName.IndexOf(quotePrefix, StringComparison.Ordinal)))
+            if (!string.IsNullOrEmpty(quotePrefix) && baseTableName.Contains(quotePrefix, StringComparison.Ordinal))
             {
                 throw ADP.DynamicSQLNestedQuote(baseTableName, quotePrefix);
             }
-            if (!string.IsNullOrEmpty(quoteSuffix) && (-1 != baseTableName.IndexOf(quoteSuffix, StringComparison.Ordinal)))
+            if (!string.IsNullOrEmpty(quoteSuffix) && baseTableName.Contains(quoteSuffix, StringComparison.Ordinal))
             {
                 throw ADP.DynamicSQLNestedQuote(baseTableName, quoteSuffix);
             }
diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs
index ec744f624af6ae..b009b3ed540917 100644
--- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs
+++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs
@@ -1013,10 +1013,7 @@ private void AddPropertySetToTypePropListMap(Type principalType, StringCollectio
         {
             lock (TypeToLdapPropListMap)
             {
-                if (!TypeToLdapPropListMap[this.MappingTableIndex].ContainsKey(principalType))
-                {
-                    TypeToLdapPropListMap[this.MappingTableIndex].Add(principalType, propertySet);
-                }
+                TypeToLdapPropListMap[MappingTableIndex].TryAdd(principalType, propertySet);
             }
         }
     }
diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs
index 9912f15555ad9b..2707afbf4b5391 100644
--- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs
+++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs
@@ -285,7 +285,11 @@ private static string EscapeSpecialCharacters(string path)
             // This is currently enforced by the order of characters in the s_specialCharacterChars array
             foreach (char c in s_specialCharacterChars)
             {
+#if NET5_0_OR_GREATER
+                if (path.Contains(c))
+#else
                 if (path.IndexOf(c) != -1)
+#endif
                 {
                     path = path.Replace(c.ToString(), Uri.HexEscape(c));
                 }
diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs
index 526a2bf676d9b5..a5035967e174e9 100644
--- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs
+++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs
@@ -379,7 +379,9 @@ private void RecordNewBinding(PackageXmlEnum propertyenum, object? value, bool i
                 _package.ThrowIfReadOnly();
 
             // Case of an existing property.
+#pragma warning disable CA1864 // Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
             if (_propertyDictionary.ContainsKey(propertyenum))
+#pragma warning restore CA1864 // Cannot use TryAdd because if the value is null it is not added if
             {
                 // Parsing should detect redundant entries.
                 if (initializing)
diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs
index d604e8a766c4be..d142afc3e0b577 100644
--- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs
+++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs
@@ -501,7 +501,7 @@ bool IEqualityComparer<string>.Equals(string? extensionA, string? extensionB)
                 //with the rules for comparing/normalizing partnames.
                 //Refer to PackUriHelper.ValidatedPartUri.GetNormalizedPartUri method.
                 //Currently normalization just involves upper-casing ASCII and hence the simplification.
-                return extensionA.ToUpperInvariant() == extensionB.ToUpperInvariant();
+                return extensionA.Equals(extensionB, StringComparison.InvariantCultureIgnoreCase);
             }
 
             int IEqualityComparer<string>.GetHashCode(string extension)
diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpEndPointManager.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpEndPointManager.cs
index e6be7fd6a0689e..5077554178e92b 100644
--- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpEndPointManager.cs
+++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpEndPointManager.cs
@@ -99,7 +99,7 @@ private static void AddPrefixInternal(string p, HttpListener listener)
             if (lp.Path!.Contains('%'))
                 throw new HttpListenerException((int)HttpStatusCode.BadRequest, SR.net_invalid_path);
 
-            if (lp.Path.IndexOf("//", StringComparison.Ordinal) != -1)
+            if (lp.Path.Contains("//"))
                 throw new HttpListenerException((int)HttpStatusCode.BadRequest, SR.net_invalid_path);
 
             // listens on all the interfaces if host name cannot be parsed by IPAddress.
@@ -206,7 +206,7 @@ private static void RemovePrefixInternal(string prefix, HttpListener listener)
             if (lp.Path!.Contains('%'))
                 return;
 
-            if (lp.Path.IndexOf("//", StringComparison.Ordinal) != -1)
+            if (lp.Path.Contains("//"))
                 return;
 
             HttpEndPointListener epl = GetEPListener(lp.Host!, lp.Port, listener, lp.Secure);
diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
index d9fa4d943bf2aa..cf84520b8549d8 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
@@ -5505,8 +5505,7 @@ public void AddEventParameter(Type type, string name)
             {
                 templates?.Append(" map=\"").Append(type.Name).Append('"');
                 mapsTab ??= new Dictionary<string, Type>();
-                if (!mapsTab.ContainsKey(type.Name))
-                    mapsTab.Add(type.Name, type);        // Remember that we need to dump the type enumeration
+                mapsTab.TryAdd(type.Name, type);        // Remember that we need to dump the type enumeration
             }
 
             templates?.AppendLine("/>");
diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs b/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs
index c9ec02441a2284..9c8487c77c8999 100644
--- a/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs
@@ -32,7 +32,9 @@ public bool Contains(char value)
 
         public bool Contains(char value, StringComparison comparisonType)
         {
+#pragma warning disable CA2249 // Consider using 'string.Contains' instead of 'string.IndexOf'... this is the implementation of Contains!
             return IndexOf(value, comparisonType) != -1;
+#pragma warning restore CA2249
         }
 
         // Returns the index of the first occurrence of a specified character in the current instance.
diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs b/src/libraries/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs
index 98a4e76ca380ec..a746ab4e52b55f 100644
--- a/src/libraries/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs
+++ b/src/libraries/System.Private.Xml/src/System/Xml/Resolvers/XmlPreloadedResolver.cs
@@ -352,14 +352,7 @@ private void Add(Uri uri, PreloadedData data)
             Debug.Assert(uri != null);
 
             // override if exists
-            if (_mappings.ContainsKey(uri))
-            {
-                _mappings[uri] = data;
-            }
-            else
-            {
-                _mappings.Add(uri, data);
-            }
+            _mappings[uri] = data;
         }
 
         private void AddKnownDtd(XmlKnownDtdData[] dtdSet)
diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs
index 9de7d560950f40..147259b5cde42b 100644
--- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs
+++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Helpers.cs
@@ -123,7 +123,11 @@ public static bool NeedsEscapingInTypeName(this char c)
 
         public static string UnescapeTypeNameIdentifier(this string identifier)
         {
+#if NET5_0_OR_GREATER
+            if (identifier.Contains('\\'))
+#else
             if (identifier.IndexOf('\\') != -1)
+#endif
             {
                 StringBuilder sbUnescapedName = new StringBuilder(identifier.Length);
                 for (int i = 0; i < identifier.Length; i++)
diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs
index 6514dcb5f576a5..b71004972ad700 100644
--- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs
+++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs
@@ -378,7 +378,7 @@ private void ReadItemFrom(XmlReader reader, SyndicationItem result, Uri feedBase
                             {
                                 bool isPermalink = true;
                                 string permalinkString = reader.GetAttribute(Rss20Constants.IsPermaLinkTag, Rss20Constants.Rss20Namespace);
-                                if ((permalinkString != null) && (permalinkString.ToUpperInvariant() == "FALSE"))
+                                if (permalinkString != null && permalinkString.Equals("FALSE", StringComparison.InvariantCultureIgnoreCase))
                                 {
                                     isPermalink = false;
                                 }
diff --git a/src/libraries/System.Speech/src/Internal/SrgsParser/XmlParser.cs b/src/libraries/System.Speech/src/Internal/SrgsParser/XmlParser.cs
index 79c87dfa6d34b0..7acbf9c03bdf15 100644
--- a/src/libraries/System.Speech/src/Internal/SrgsParser/XmlParser.cs
+++ b/src/libraries/System.Speech/src/Internal/SrgsParser/XmlParser.cs
@@ -168,7 +168,7 @@ internal static void ParseText(IElement parent, string sChars, string pronunciat
                 }
 
                 string sToken = sChars.Substring(i, iTokenEnd - i);
-                if (sToken.IndexOf('"') != -1)
+                if (sToken.Contains('"'))
                 {
                     // "The token string is not allowed to contain double quote character."
                     XmlParser.ThrowSrgsException(SRID.InvalidTokenString);
diff --git a/src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs b/src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs
index 38ca23fedee837..ebd5b17ee8c922 100644
--- a/src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs
+++ b/src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs
@@ -397,7 +397,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
 
         protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
         {
-            if (!ShowCompilerWarnings && singleLine.IndexOf("warning:", StringComparison.OrdinalIgnoreCase) != -1)
+            if (!ShowCompilerWarnings && singleLine.Contains("warning:", StringComparison.OrdinalIgnoreCase))
             {
                 Log.LogMessage(MessageImportance.Normal, singleLine);
                 WarningsDetected = true;
diff --git a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
index 423aa4a5561f6a..e520057d5b3bdf 100644
--- a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
+++ b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
@@ -274,7 +274,7 @@ private void UpdateAppRef(string sdkPath, string version)
         private string GetNuGetConfig()
         {
             string contents = File.ReadAllText(TemplateNuGetConfigPath);
-            if (contents.IndexOf(s_nugetInsertionTag, StringComparison.InvariantCultureIgnoreCase) < 0)
+            if (!contents.Contains(s_nugetInsertionTag, StringComparison.InvariantCultureIgnoreCase))
                 throw new LogAsErrorException($"Could not find {s_nugetInsertionTag} in {TemplateNuGetConfigPath}");
 
             return contents.Replace(s_nugetInsertionTag, $@"<add key=""nuget-local"" value=""{LocalNuGetsPath}"" />");
@@ -423,7 +423,7 @@ internal sealed record InstallWorkloadRequest(
             public string Version => Workload.GetMetadata("Version");
             public string TargetPath => Target.GetMetadata("InstallPath");
             public string StampPath => Target.GetMetadata("StampPath");
-            public bool IgnoreErrors => Workload.GetMetadata("IgnoreErrors").ToLowerInvariant() == "true";
+            public bool IgnoreErrors => Workload.GetMetadata("IgnoreErrors").Equals("true", StringComparison.InvariantCultureIgnoreCase);
             public string WorkloadId => Workload.ItemSpec;
 
             public bool Validate(TaskLoggingHelper log)
diff --git a/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs b/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs
index 12aff7c133ec15..e96ce5a22f5250 100644
--- a/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs
+++ b/src/tools/illink/src/linker/Linker.Steps/ProcessLinkerXmlBase.cs
@@ -162,7 +162,7 @@ protected virtual void ProcessTypes (AssemblyDefinition assembly, XPathNavigator
 
 				string fullname = GetFullName (typeNav);
 
-				if (fullname.IndexOf ("*") != -1) {
+				if (fullname.Contains ('*')) {
 					if (ProcessTypePattern (fullname, assembly, typeNav))
 						continue;
 				}
