if ((stringValue.IndexOf("pink") > -1)) is inefficient #10880
Labels
area-WinForms
Issues or PRs that relate to WinForms.
untriaged
New issue has not been triaged by the area owner
Type of issue
Typo
Description
The code example shouldn't read:
if ((stringValue.IndexOf("pink") > -1))
This is more efficient:
if ((stringValue.IndexOf("pink") != -1))
Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.datagridview.cellformatting?view=windowsdesktop-9.0&redirectedfrom=MSDN
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Windows.Forms/DataGridView.xml
Document Version Independent Id
d789c17f-da81-5aca-c7f2-63c547287417
Article author
@dotnet-bot
The text was updated successfully, but these errors were encountered: