Skip to content

Wrong remark #11556

Open
Open
@obartelt

Description

@obartelt

Type of issue

Other (describe below)

Description

The remarks made on this page related to an empty anyOf character array being passed into the function are wrong. The documentation states:

If anyOf is an empty array, the method finds a match at the beginning of the string (that is, at index zero).

Whereas in reality, -1 is returned. Tested with .NET Framework 4.8 as well as .NET 8.0. Might be different in .NET 10, but then it would be a breaking change, which I haven't found anywhere.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.string.indexofany?view=netframework-4.7.2&devlangs=csharp&f1url=%3FappId%3DDev17IDEF1%26l%3DDE-DE%26k%3Dk(System.String.IndexOfAny)%3Bk(DevLang-csharp)%26rd%3Dtrue

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System/String.xml

Document Version Independent Id

adc47b27-e2ac-45a7-dd56-77dcb6be0f7f

Platform Id

03aae330-04cc-2e30-ecd8-89dd5afe6fe3

Article author

@dotnet-bot

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownersuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions