﻿<?xml version="1.0" encoding="utf-8"?><Type Name="StringComparison" FullName="System.StringComparison"><TypeSignature Language="C#" Value="public enum StringComparison" /><TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed StringComparison extends System.Enum" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>System.Enum</BaseTypeName></Base><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><since version=".NET 2.0" /><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The <see cref="T:System.StringComparison" /> enumeration is used to specify whether a string comparison should use the current culture or the invariant culture, word or ordinal sort rules, and be case-sensitive or case-insensitive.</para><block subset="none" type="note"><para>When you call a string comparison method such as <see cref="M:System.String.Compare(System.String,System.String)" />, <see cref="M:System.String.Equals(System.String)" />, or <see cref="M:System.String.IndexOf(System.String)" />, you should always call an overload that includes a parameter of type <see cref="T:System.StringComparison" /> so that you can specify the type of comparison that the method performs. For more information, see <format type="text/html"><a href="b9f0bf53-e2de-4116-8ce9-d4f91a1df4f7">Best Practices for Using Strings in the .NET Framework</a></format>.</para></block><para>An operation that uses word sort rules performs a culture-sensitive comparison wherein certain nonalphanumeric Unicode characters might have special weights assigned to them. Using word sort rules and the conventions of a specific culture, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list.</para><para>An operation that uses ordinal sort rules performs a comparison based on the numeric value (Unicode code point) of each <see cref="T:System.Char" /> in the string. An ordinal comparison is fast but culture-insensitive. When you use ordinal sort rules to sort strings that start with Unicode characters (U+), the string U+xxxx comes before the string U+yyyy if the value of xxxx is numerically less than yyyy.</para><para>For more information about comparisons, see the <see cref="T:System.String" /> class remarks. For more information about culture, see the <see cref="T:System.Globalization.CultureInfo" /> class remarks. For guidelines on when to use ordinal or culture-sensitive comparison rules or the rules of the invariant culture, see <format type="text/html"><a href="b9f0bf53-e2de-4116-8ce9-d4f91a1df4f7">Best Practices for Using Strings in the .NET Framework</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Specifies the culture, case, and sort rules to be used by certain overloads of the <see cref="M:System.String.Compare(System.String,System.String)" /> and <see cref="M:System.String.Equals(System.Object)" /> methods.</para></summary></Docs><Members><Member MemberName="CurrentCulture"><MemberSignature Language="C#" Value="CurrentCulture" /><MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.StringComparison CurrentCulture = int32(0)" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.StringComparison</ReturnType></ReturnValue><Docs><since version=".NET 2.0" /><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compare strings using culture-sensitive sort rules and the current culture.</para></summary></Docs></Member><Member MemberName="CurrentCultureIgnoreCase"><MemberSignature Language="C#" Value="CurrentCultureIgnoreCase" /><MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.StringComparison CurrentCultureIgnoreCase = int32(1)" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.StringComparison</ReturnType></ReturnValue><Docs><since version=".NET 2.0" /><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compare strings using culture-sensitive sort rules, the current culture, and ignoring the case of the strings being compared.</para></summary></Docs></Member><Member MemberName="InvariantCulture"><MemberSignature Language="C#" Value="InvariantCulture" /><MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.StringComparison InvariantCulture = int32(2)" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.StringComparison</ReturnType></ReturnValue><Docs><since version=".NET 2.0" /><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compare strings using culture-sensitive sort rules and the invariant culture.</para></summary></Docs></Member><Member MemberName="InvariantCultureIgnoreCase"><MemberSignature Language="C#" Value="InvariantCultureIgnoreCase" /><MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.StringComparison InvariantCultureIgnoreCase = int32(3)" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.StringComparison</ReturnType></ReturnValue><Docs><since version=".NET 2.0" /><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compare strings using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings being compared.</para></summary></Docs></Member><Member MemberName="Ordinal"><MemberSignature Language="C#" Value="Ordinal" /><MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.StringComparison Ordinal = int32(4)" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.StringComparison</ReturnType></ReturnValue><Docs><since version=".NET 2.0" /><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compare strings using ordinal sort rules.</para></summary></Docs></Member><Member MemberName="OrdinalIgnoreCase"><MemberSignature Language="C#" Value="OrdinalIgnoreCase" /><MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.StringComparison OrdinalIgnoreCase = int32(5)" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.StringComparison</ReturnType></ReturnValue><Docs><since version=".NET 2.0" /><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compare strings using ordinal sort rules and ignoring the case of the strings being compared.</para></summary></Docs></Member></Members></Type>