dotnet / dotnet/dotnet-api-docs

`StringSort` does not work as described in the docs

Open
#9,014 2 comments 0 reactions 0 assignees View on GitHub
area-System.Globalization doc-bug Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

.NET 7, Console App, but actually it happens for net6, net 5, net core 3.1 as well. The last dotnet that works as the docs is framework 4.7.2, so it looks like it's by design.

This is what docs claim to happen (see the comment in the end of the example):
https://learn.microsoft.com/en-us/dotnet/api/system.globalization.compareoptions?view=net-7.0#examples

While this is what is happening:
```
Initially,
cant
bill's
coop
cannot
billet
can't
con
bills
co-op

After sorting without CompareOptions.StringSort:
bill's
billet
bills
can't
cannot
cant
co-op
con
coop

After sorting with CompareOptions.StringSort:
bill's
billet
bills
can't
cannot
cant
co-op
con
coop
```

Most probably there was copy-paste error. In case it is not by design, we need to fix it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.