Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 867 Bytes

RR0144.md

File metadata and controls

34 lines (24 loc) · 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)