Call string.IndexOf instead of string.Contains
Property | Value |
---|---|
Id | RR0144 |
Applicable Syntax | method invocation |
Syntax Span | method name |
Enabled by Default | ✓ |
Usage
Example #1
before.cs
if (s.Contains("a"))
{
{
after.cs
if (s.IndexOf("a", StringComparison.OrdinalIgnoreCase) != -1)
{
{
Configuration
roslynator_refactoring.call_indexof_instead_of_contains.enabled = true|false