Permalink
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (24 sloc) 867 Bytes

Call string.IndexOf instead of string.Contains

Property Value
Id RR0144
Title Call string.IndexOf instead of string.Contains
Syntax method invocation
Span method name
Enabled by Default

Usage

Before

if (s.Contains("a"))
{
{

After

if (s.IndexOf("a", StringComparison.OrdinalIgnoreCase) != -1)
{
{

See Also

(Generated with DotMarkdown)