Skip to content

Prefer string.Contains() over string.IndexOf() != -1 #33785

@terrajobst

Description

@terrajobst

Calls to String.IndexOf(...) where the result is then just compared to -1 can instead be replaced by calls to String.Contains(...).

Category: Performance

Metadata

Metadata

Assignees

Labels

api-approvedAPI was approved in API review, it can be implementedarea-System.Runtimecode-analyzerMarks an issue that suggests a Roslyn analyzercode-fixerMarks an issue that suggests a Roslyn code fixer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions