-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Description
On this page it sais:
- In previous versions of .NET on Windows, the snippet prints 6.
- In .NET 5 and later versions on Windows 19H1 and later versions, the snippet prints -1.
but when I run that code snippet, in a new .NET 6 project in Visual Studio 2022, it still returns 6!
string s = "Hello\r\nworld!";
int idx = s.IndexOf("\n");
Console.WriteLine(idx);
When we create a project with .NET 5, it does return -1. But with NET 6 (a version later then 5) it returns 6! What is going on?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 13ed30d9-9cee-e81a-9b94-702c37569d35
- Version Independent ID: 0fe8d49e-09ec-0164-7dd7-671299358deb
- Content: Breaking change: Globalization APIs use ICU libraries on Windows - .NET
- Content Source: docs/core/compatibility/globalization/5.0/icu-globalization-api.md
- Product: dotnet-fundamentals
- GitHub Login: @gewarren
- Microsoft Alias: gewarren