| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Performing Culture-Insensitive String Operations |
03/30/2017 |
.net |
dotnet-standard |
article |
|
579ef891-1f83-4c63-9ebd-2f40406b5b91 |
13 |
rpetrusha |
ronpet |
wpickett |
Performing Culture-Insensitive String Operations
Most .NET Framework methods that perform culture-sensitive string operations by default provide method overloads that allow you to explicitly specify the culture to use by passing a xref:System.Globalization.CultureInfo parameter. These overloads allow you to eliminate cultural variations in case mappings and sorting rules and guarantee culture-insensitive results.
This section provides the following topics to demonstrate how to perform culture-insensitive string operations using .NET Framework methods that are culture-sensitive by default.
In This Section
Performing Culture-Insensitive String Comparisons
Describes how to use the xref:System.String.Compare%2A?displayProperty=nameWithType and xref:System.String.CompareTo%2A?displayProperty=nameWithType methods to perform culture-insensitive string comparisons.
Performing Culture-Insensitive Case Changes
Describes how to use the xref:System.String.ToUpper%2A?displayProperty=nameWithType, xref:System.String.ToLower%2A?displayProperty=nameWithType, xref:System.Char.ToUpper%2A?displayProperty=nameWithType, and xref:System.Char.ToLower%2A?displayProperty=nameWithType methods to perform culture-insensitive case changes.
Performing Culture-Insensitive String Operations in Collections
Describes how to use the xref:System.Collections.CaseInsensitiveComparer, xref:System.Collections.CaseInsensitiveHashCodeProvider class, xref:System.Collections.SortedList, xref:System.Collections.ArrayList.Sort%2A?displayProperty=nameWithType and xref:System.Collections.Specialized.CollectionsUtil.CreateCaseInsensitiveHashtable%2A?displayProperty=nameWithType to perform culture-insensitive operations in collections.
Performing Culture-Insensitive String Operations in Arrays
Describes how to use the xref:System.Array.Sort%2A?displayProperty=nameWithType and xref:System.Array.BinarySearch%2A?displayProperty=nameWithType methods to perform culture-insensitive operations in arrays.
Related Sections
Culture-Insensitive String Operations
Describes why you should be aware of culture when performing operations on strings and provides guidelines for when to perform culture-sensitive operations and when to perform culture-insensitive operations.