Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:csharp-best-practices/indexof-checks
Language: C#
Severity: Warning
Category: Error Prone
Description
When using Indexof or LastIndexOf, using > 0 may miss the first item of the collection (string, list, etc). Instead, the code should use >=0 to take the first element into account.