|
37 | 37 | <remarks> |
38 | 38 | <format type="text/markdown"><] through the [!INCLUDE[net_v40_short](~/includes/net-v40-short-md.md)], each version of the.NET Framework has included tables that contain sort weights and data on string normalization and that are based on a particular version of Unicode. In the [!INCLUDE[net_v45](~/includes/net-v45-md.md)], the presence of these tables depends on the operating system: |
42 | 45 | |
43 | 46 | - On [!INCLUDE[win7](~/includes/win7-md.md)] and previous versions of the Windows operating system, the tables continue to be used for comparing and ordering strings. |
|
53 | 56 | |[!INCLUDE[net_v45](~/includes/net-v45-md.md)] and later versions of the .NET Framework|[!INCLUDE[win8](~/includes/win8-md.md)] and later Windows operating system versions|Unicode 6.0| |
54 | 57 | |
55 | 58 | On [!INCLUDE[win8](~/includes/win8-md.md)], because the version of Unicode used in string comparison and ordering depends on the version of the operating system, the results of string comparison may differ even for applications that run on a specific version of the .NET Framework. |
56 | | - |
57 | | - The <xref:System.Globalization.SortVersion> class provides information about the Unicode version used by the .NET Framework for string comparison and ordering. It enables developers to write applications that can detect and successfully handle changes in the version of Unicode that is used to compare and sort an application's strings. |
| 59 | +
|
| 60 | +### Sorting and string comparison in .NET Core |
| 61 | +
|
| 62 | +All versions of .NET Core rely on the underlying operating system when performing string comparisons. Therefore, the results of a string comparison or the order in which strings are sorted depends on the version of Unicode used by the operating system when performing the comparison. On Linux and macOS, [International Components for Unicode](http://site.icu-project.org/) libraries provide the implementation for comparison and sorting APIs. |
| 63 | +
|
| 64 | +### Using the SortVersion class |
| 65 | +
|
| 66 | + The <xref:System.Globalization.SortVersion> class provides information about the Unicode version used by .NET for string comparison and ordering. It enables developers to write applications that can detect and successfully handle changes in the version of Unicode that is used to compare and sort an application's strings. |
58 | 67 | |
59 | 68 | You can instantiate a <xref:System.Globalization.SortVersion> object in two ways: |
60 | 69 | |
61 | 70 | - By calling the <xref:System.Globalization.SortVersion.%23ctor%2A> constructor, which instantiates a new <xref:System.Globalization.SortVersion> object based on a version number and sort ID. This constructor is most useful when recreating a <xref:System.Globalization.SortVersion> object from saved data. |
62 | 71 | |
63 | | -- By retrieving the value of the <xref:System.Globalization.CompareInfo.Version%2A?displayProperty=nameWithType> property. This property provides information about the Unicode version used by the .NET Framework on which the application is running. |
| 72 | +- By retrieving the value of the <xref:System.Globalization.CompareInfo.Version%2A?displayProperty=nameWithType> property. This property provides information about the Unicode version used by the .NET implementation on which the application is running. |
64 | 73 | |
65 | 74 | The <xref:System.Globalization.SortVersion> class has two properties, <xref:System.Globalization.SortVersion.FullVersion%2A> and <xref:System.Globalization.SortVersion.SortId%2A>, that indicate the Unicode version and the specific culture used for string comparison. The <xref:System.Globalization.SortVersion.FullVersion%2A> property is an arbitrary numeric value that reflects the Unicode version used for string comparison, and the <xref:System.Globalization.SortVersion.SortId%2A> property is an arbitrary <xref:System.Guid> that reflects the culture whose conventions are used for string comparison. The values of these two properties are important only when you compare two <xref:System.Globalization.SortVersion> objects by using the <xref:System.Globalization.SortVersion.Equals%2A> method, the <xref:System.Globalization.SortVersion.op_Equality%2A> operator, or the <xref:System.Globalization.SortVersion.op_Inequality%2A> operator. |
66 | 75 | |
|
0 commit comments