Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters #10297

Open
Tracked by #10270
himgoyalmicro opened this issue Jan 16, 2025 · 0 comments · May be fixed by #10144
Open
Tracked by #10270
Assignees
Labels
area-Styling Indicates if an issue or a PR is for style changes 🚧 work in progress

Comments

@himgoyalmicro
Copy link
Contributor

himgoyalmicro commented Jan 16, 2025

Link to the issue description: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1847

Rule Description:

When searching for a single character, String.Contains(char) offers better performance than String.Contains(string).

@himgoyalmicro himgoyalmicro changed the title CA1847 CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters Jan 16, 2025
@himgoyalmicro himgoyalmicro self-assigned this Jan 16, 2025
@himgoyalmicro himgoyalmicro added the area-Styling Indicates if an issue or a PR is for style changes label Jan 16, 2025
@himgoyalmicro himgoyalmicro linked a pull request Jan 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Styling Indicates if an issue or a PR is for style changes 🚧 work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant