{"id":273394,"date":"2016-02-02T12:00:03","date_gmt":"2016-02-02T09:00:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=273394"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=273394","title":{"rendered":"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0432 C# (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)"},"content":{"rendered":"<p>       \u0427\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c 2 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb397919.aspx\">LINQ to Objects<\/a>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f. <br \/>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u0432\u043d\u0430 O(n). \u041d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u043e \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u044d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438, <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb549267(v=vs.110).aspx\">\u0443\u043a\u0430\u0437\u0430\u0432 IEqualityComparer&lt;string&gt; \u044f\u0432\u043d\u043e<\/a>, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0431\u044b\u0441\u0442\u0440\u0435\u0435?  <\/p>\n<pre><code class=\"cs\">clients.Join(orders,                     c =&gt; c.Name,                     o =&gt; o.ClientName,                     (c, o) =&gt; CreateOrederDto(c, o)); <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b \u0435\u0451 \u044f\u0432\u043d\u043e? <br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 <a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/3d8569f7f2c8dd387366cbd2ef1b1cc4edab7038\/src\/System.Linq\/src\/System\/Linq\/Enumerable.cs#L938\">\u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 Join<\/a> \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"cs\">public static IEnumerable&lt;TResult&gt; Join&lt;TOuter, TInner, TKey, TResult&gt;(this IEnumerable&lt;TOuter&gt; outer, IEnumerable&lt;TInner&gt; inner, Func&lt;TOuter, TKey&gt; outerKeySelector, Func&lt;TInner, TKey&gt; innerKeySelector, Func&lt;TOuter, TInner, TResult&gt; resultSelector) {     if (outer == null) throw Error.ArgumentNull(&quot;outer&quot;);     if (inner == null) throw Error.ArgumentNull(&quot;inner&quot;);     if (outerKeySelector == null) throw Error.ArgumentNull(&quot;outerKeySelector&quot;);     if (innerKeySelector == null) throw Error.ArgumentNull(&quot;innerKeySelector&quot;);     if (resultSelector == null) throw Error.ArgumentNull(&quot;resultSelector&quot;);     return JoinIterator&lt;TOuter, TInner, TKey, TResult&gt;(outer, inner, outerKeySelector, innerKeySelector, resultSelector, null); }  static IEnumerable&lt;TResult&gt; JoinIterator&lt;TOuter, TInner, TKey, TResult&gt;(IEnumerable&lt;TOuter&gt; outer, IEnumerable&lt;TInner&gt; inner, Func&lt;TOuter, TKey&gt; outerKeySelector, Func&lt;TInner, TKey&gt; innerKeySelector, Func&lt;TOuter, TInner, TResult&gt; resultSelector, IEqualityComparer&lt;TKey&gt; comparer) {     Lookup&lt;TKey, TInner&gt; lookup = Lookup&lt;TKey, TInner&gt;.CreateForJoin(inner, innerKeySelector, comparer);     foreach (TOuter item in outer) {         Lookup&lt;TKey, TInner&gt;.Grouping g = lookup.GetGrouping(outerKeySelector(item), false);         if (g != null) {             for (int i = 0; i &lt; g.count; i++) {                 yield return resultSelector(item, g.elements[i]);             }         }     } } <\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0432 \u043c\u0435\u0442\u043e\u0434 JoinIterator \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f null, \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Lookup \u0432 \u043c\u0435\u0442\u043e\u0434 CreateForJoin.<\/p>\n<p>  <i>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb460184(v=vs.110).aspx\">Lookup<\/a> \u043d\u0435\u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u043e \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u043f\u0440\u043e\u0441\u0442\u043e <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb292716(v=vs.110).aspx\">\u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f<\/a>.<\/i><\/p>\n<p>  \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/3d8569f7f2c8dd387366cbd2ef1b1cc4edab7038\/src\/System.Linq\/src\/System\/Linq\/Enumerable.cs#L3250\">CreateForJoin<\/a>:  <\/p>\n<pre><code class=\"cs\">internal static Lookup&lt;TKey, TElement&gt; CreateForJoin(IEnumerable&lt;TElement&gt; source, Func&lt;TElement, TKey&gt; keySelector, IEqualityComparer&lt;TKey&gt; comparer) {     Lookup&lt;TKey, TElement&gt; lookup = new Lookup&lt;TKey, TElement&gt;(comparer);     ... }  Lookup(IEqualityComparer&lt;TKey&gt; comparer) {     if (comparer == null) comparer = EqualityComparer&lt;TKey&gt;.Default;     this.comparer = comparer;     groupings = new Grouping[7]; \/\/ 7 - \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0447\u0438\u0441\u043b\u043e, \u043f\u0443\u0441\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 7 } <\/code><\/pre>\n<h4>EqualityComparer<\/h4>\n<p>  Generic-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms132151(v=vs.110).aspx\">IEqualityComparer&lt;T&gt;<\/a> \u0438\u043c\u0435\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/3d8569f7f2c8dd387366cbd2ef1b1cc4edab7038\/src\/System.Collections\/src\/System\/Collections\/Generic\/EqualityComparer.cs\">EqualityComparer&lt;T&gt;<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms224763(v=vs.110).aspx\">Default<\/a> \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0443\u043c\u043e\u043b\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 T. \u0422\u043e \u0435\u0441\u0442\u044c, \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e T, \u043a\u043b\u0430\u0441\u0441\u0430, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <br \/>  <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/ef1e2ab328087c61a6878c1e84f4fc5d710aebce\/src\/mscorlib\/src\/System\/Collections\/Generic\/EqualityComparer.cs#L43\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0431\u043e\u0440\u0430<\/a> \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u0438\u0442\u0438\u0435\u0432\u0430\u0442, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0438\u0445 Join \u0438 GroupBy.   <\/p>\n<ol>\n<li>\u0414\u043b\u044f byte \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u0441\u0432\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0439 ByteEqualityComparer. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0431\u0430\u0439\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e IndexOf \u0434\u043b\u044f \u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/li>\n<li>\u0415\u0441\u043b\u0438 T \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IEquatable&lt;T&gt;, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/ef1e2ab328087c61a6878c1e84f4fc5d710aebce\/src\/mscorlib\/src\/System\/Collections\/Generic\/EqualityComparer.cs#L129\">GenericEqualityComparer&lt;T&gt;<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u0430 IEquatable&lt;T&gt;.Equals(T). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043e\u0431\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e null.<\/li>\n<li>\u0415\u0441\u043b\u0438 T \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 Nullable&lt;U&gt;, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IEquatable&lt;U&gt;, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043a\u043b\u0430\u0441\u0441 NullableEqualityComparer&lt;T&gt;, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 HasValue.<\/li>\n<li>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 EnumEqualityComparer&lt;T&gt; (\u0434\u043b\u044f \u0442\u0438\u043f\u0430 long \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e JIT-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043a \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e.<\/li>\n<li>\u0412\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f ObjectEqualityComparer&lt;T&gt;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bsc2ak47(v=vs.110).aspx\">Object.Equals<\/a>. \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u2014 \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0441\u0441\u044b\u043b\u043e\u043a, \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u2014 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 ObjectEqualityComparer&lt;T&gt; \u0432\u0441\u0435\u0433\u0434\u0430 true) \u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/li>\n<\/ol>\n<p>  \u041a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.string(v=vs.110).aspx\">String<\/a> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IEquatable&lt;T&gt; \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u0442\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. <br \/>  <i>\u0414\u043b\u044f .NET Core \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/3d8569f7f2c8dd387366cbd2ef1b1cc4edab7038\/src\/System.Collections\/src\/System\/Collections\/Generic\/EqualityComparer.cs#L21\">\u0434\u0440\u0443\u0433\u0430\u044f<\/a> \u2014 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d <a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/3d8569f7f2c8dd387366cbd2ef1b1cc4edab7038\/src\/System.Collections\/src\/System\/Collections\/Generic\/EqualityComparer.cs#L321\">EqualityComparerForString<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 ==.<\/i><\/p>\n<h4>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a<\/h4>\n<p>  \u041c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/ef1e2ab328087c61a6878c1e84f4fc5d710aebce\/src\/mscorlib\/src\/System\/String.cs#L518\">String.Equals(string value)<\/a> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0441\u0441\u044b\u043b\u043e\u043a \u0441\u0442\u0440\u043e\u043a, \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 (\u043f\u043e\u0447\u0442\u0438) <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/ef1e2ab328087c61a6878c1e84f4fc5d710aebce\/src\/mscorlib\/src\/System\/String.cs#L356\">\u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0441\u0442\u0440\u043e\u043a<\/a>:  <\/p>\n<pre><code class=\"cs\">[System.Security.SecuritySafeCritical]  \/\/ auto-generated [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] private unsafe static bool EqualsHelper(String strA, String strB) {     int length = strA.Length;       fixed (char* ap = &strA.m_firstChar)      fixed (char* bp = &strB.m_firstChar)     {         char* a = ap;         char* b = bp;           \/\/ \u0440\u0430\u0437\u043c\u043e\u0442\u043a\u0430 \u0446\u0438\u043a\u043b\u0430 #if AMD64         \/\/ \u0414\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b AMD64 \u0440\u0430\u0437\u043c\u043e\u0442\u043a\u0430 \u043f\u043e 12 \u0431\u0430\u0439\u0442 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 3 qword \u0437\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e.           while (length &gt;= 12)         {             if (*(long*)a     != *(long*)b) return false;             if (*(long*)(a+4) != *(long*)(b+4)) return false;             if (*(long*)(a+8) != *(long*)(b+8)) return false;             a += 12; b += 12; length -= 12;         } #else         while (length &gt;= 10)         {             if (*(int*)a != *(int*)b) return false;             if (*(int*)(a+2) != *(int*)(b+2)) return false;             if (*(int*)(a+4) != *(int*)(b+4)) return false;             if (*(int*)(a+6) != *(int*)(b+6)) return false;             if (*(int*)(a+8) != *(int*)(b+8)) return false;             a += 10; b += 10; length -= 10;         } #endif           \/\/ \u0414\u043b\u044f \u0441\u0442\u0440\u043e\u043a \u0441 \u043d\u0435\u0447\u0451\u0442\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \\0         while (length &gt; 0)          {             if (*(int*)a != *(int*)b) break;             a += 2; b += 2; length -= 2;         }           return (length &lt;= 0);     } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 Microsoft \u0434\u0430\u0436\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/\u0420\u0430\u0437\u043c\u043e\u0442\u043a\u0430_\u0446\u0438\u043a\u043b\u0430\">\u0440\u0430\u0437\u043c\u043e\u0442\u0430\u043b\u0438 \u0446\u0438\u043a\u043b\u044b<\/a>.<br \/>  \u0418\u0442\u0430\u043a, <b>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a<\/b>. \u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e? \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435. \u0410 \u043a\u0430\u043a \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438?<\/p>\n<h4>StringComparer<\/h4>\n<p>  \u0414\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 String \u0432 .net \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.stringcomparer(v=vs.110).aspx\">StringComparer<\/a> \u0438 \u0440\u044f\u0434 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043d\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0441\u0442\u044c 6 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a 3 \u0432\u0438\u0434\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0438 \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043a\u0430\u0436\u0434\u044b\u0439:  <\/p>\n<ul>\n<li>CurrentCulture\/CurrentCultureIgnoreCase \u2014 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0438 \u044f\u0437\u044b\u043a\u0430 (\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e Thread)<\/li>\n<li>InvariantCulture\/InvariantCultureIgnoreCase \u2014 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u044f\u0437\u044b\u043a\u0430 \u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0438 \u044f\u0437\u044b\u043a\u0430 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f CultureInfo.InvariantCulture)<\/li>\n<li>Ordinal\/OrdinalIgnoreCase \u2014 \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/li>\n<\/ul>\n<p>  <i>\u0422\u0430\u043a \u043a\u0430\u043a StringComparer \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IEqualityComparer&lt;string&gt;, \u0442\u043e \u0432\u0441\u0435 \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f IEqualityComparer&lt;string&gt;.<\/i><br \/>  \u042f \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u043d\u0438 \u0440\u0430\u0437\u0443 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u00ab\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b\u00bb.<br \/>  \u0411\u0443\u0434\u0435\u0442 \u043b\u0438 \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 EqualityComparer&lt;String&gt;.Default \u0438\u043b\u0438 \u044f\u0432\u043d\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 Equals? \u0417\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/mscorlib\/src\/System\/StringComparer.cs#L275\">OrdinalComparer<\/a>:  <\/p>\n<pre><code class=\"cs\">public override bool Equals(string x, string y) {     if (Object.ReferenceEquals(x ,y)) return true;     if (x == null || y == null) return false;       if( _ignoreCase) {         if( x.Length != y.Length) {             return false;         }         return (String.Compare(x, y, StringComparison.OrdinalIgnoreCase) == 0);                                                 }     return x.Equals(y); }   <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0447\u0451\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0441\u0441\u044b\u043b\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 null. \u042d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u0445\u043e\u0442\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f MSIL \u044d\u0442\u043e \u043f\u0430\u0440\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439:  <\/p>\n<pre><code>\tIL_0000: nop \tIL_0001: ldarg.0 \tIL_0002: ldarg.1 \tIL_0003: call bool [mscorlib]System.Object::ReferenceEquals(object, object) \tIL_0008: ldc.i4.0 \tIL_0009: ceq \tIL_000b: stloc.1 \tIL_000c: ldloc.1 \tIL_000d: brtrue.s IL_0013  \tIL_000f: ldc.i4.1 \tIL_0010: stloc.0 \tIL_0011: br.s IL_003e  \tIL_0013: ldarg.0 \tIL_0014: brfalse.s IL_001f  \tIL_0016: ldarg.1 \tIL_0017: ldnull \tIL_0018: ceq \tIL_001a: ldc.i4.0 \tIL_001b: ceq \tIL_001d: br.s IL_0020  \tIL_001f: ldc.i4.0  \tIL_0020: nop \tIL_0021: stloc.1 \tIL_0022: ldloc.1 \tIL_0023: brtrue.s IL_0029  \tIL_0025: ldc.i4.0 \tIL_0026: stloc.0 \tIL_0027: br.s IL_003e <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430? \u041f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f, \u044f \u0438 \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u043b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.string.tolower(v=vs.110).aspx\">ToLower<\/a>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b. \u041d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u0435\u0432\u0437\u043e\u0448\u0451\u043b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f. \u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 String.Compare(x, y, StringComparison.OrdinalIgnoreCase) \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/mscorlib\/src\/System\/String.cs#L1798\">\u0432\u0435\u0442\u0432\u044c \u043a\u043e\u0434\u0430<\/a>:  <\/p>\n<pre><code class=\"cs\">case StringComparison.OrdinalIgnoreCase: \tif (this.Length != value.Length) \t\treturn false;   \t\/\/ \u0415\u0441\u043b\u0438 \u043e\u0431\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e ASCII \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0439\u0442\u0438 \u043f\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u043f\u0443\u0442\u0438. \tif (this.IsAscii() && value.IsAscii()) { \t\treturn (CompareOrdinalIgnoreCaseHelper(this, value) == 0); \t} #if FEATURE_COREFX_GLOBALIZATION         return CompareInfo.CompareOrdinalIgnoreCase(strA, 0, strA.Length, strB, 0, strB.Length); #else \t\/\/ \u041c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \treturn TextInfo.CompareOrdinalIgnoreCase(strA, strB); #endif <\/code><\/pre>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 IsAscii \u0431\u044b\u043b\u0430 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0430? <br \/>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 ASCII-\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e, \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0438, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435\u043c 0x20.   <\/p>\n<pre><code class=\"cs\">private unsafe static int CompareOrdinalIgnoreCaseHelper(String strA, String strB) {     int length = Math.Min(strA.Length, strB.Length);          fixed (char* ap = &strA.m_firstChar)      fixed (char* bp = &strB.m_firstChar)     {         char* a = ap;         char* b = bp;           while (length != 0)          {             int charA = *a;             int charB = *b;               Contract.Assert((charA | charB) &lt;= 0x7F, &quot;strings have to be ASCII&quot;);               \/\/ \u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043e\u0431\u043e\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0434\u043d\u0438\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c             if ((uint)(charA - 'a') &lt;= (uint)('z' - 'a')) charA -= 0x20;             if ((uint)(charB - 'a') &lt;= (uint)('z' - 'a')) charB -= 0x20;               if (charA != charB)                 return charA - charB;               \/\/ \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b             a++; b++;             length--;         }           return strA.Length - strB.Length;     } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0435 ASCII \u0441\u0442\u0440\u043e\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/classlibnative\/nls\/nlsinfo.cpp#L2546\">\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434<\/a> \u043d\u0430 C++ \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \u044f\u0434\u0440\u0430 Windows \u0438\u043b\u0438 (\u0441\u0443\u0434\u044f \u043f\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c, \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Windows XP) <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/utilcode\/downlevel.cpp#L1593\">\u043c\u0435\u0442\u043e\u0434<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<p>  <i>\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0432\u044b\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043e\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435.<\/i><\/p>\n<p>  \u0410 \u0447\u0442\u043e \u043d\u0430 \u0441\u0447\u0451\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440? \u041a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/mscorlib\/src\/System\/StringComparer.cs#L129\">CultureAwareComparer<\/a> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0444\u043b\u0430\u0433, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0439 \u043e \u0442\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.globalization.compareinfo(v=vs.110).aspx\">CompareInfo<\/a>, \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 CultureAwareComparer.  <\/p>\n<pre><code class=\"cs\">return (_compareInfo.Compare(x, y, _ignoreCase? CompareOptions.IgnoreCase :  CompareOptions.None) == 0); <\/code><\/pre>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/classlibnative\/nls\/nlsinfo.cpp#L1648\">\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043d\u043e\u0432\u0430 \u043b\u0435\u0437\u0435\u0442 \u0432 \u044f\u0434\u0440\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0440\u043e\u043a. \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432\u043e\u0442 \u0432\u0430\u043c \u043e\u0442\u0440\u044b\u0432\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 coreclr:  <\/p>\n<pre><code class=\"cpp\">\/\/ TODO: Remove this workaround after Vista SP2 &\/or turkic CompareStringEx() gets fixed on Vista. \/\/ If its Vista and we want a turkik sort, then call CompareStringW not CompareStringEx LPCWSTR pLingLocaleName = AvoidVistaTurkishBug ? GetLingusticLocaleName((LPWSTR)lpLocaleName, dwCmpFlags) : lpLocaleName; \/\/ TODO: End of workaround for turkish CompareStringEx() on Vista\/Win2K8 <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c, <b>\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a .net \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0438 \u044f\u0437\u044b\u043a\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/b>.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0438\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u043b\u0438 \u0441\u0433\u0440\u0430\u0431\u0438\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/Vadimyan\/StringComparationBenchmark\">GitHub<\/a>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0432\u0430\u043b\u0438, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e 10.000 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e 1.000.000 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438 \u0431\u0435\u0437 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430.  <\/p>\n<table>\n<tr>\n<th>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/th>\n<th>\u041c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\/1.000.000 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/th>\n<th>\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430<\/th>\n<\/tr>\n<tr>\n<td>string.Equals<\/td>\n<td>25.8<\/td>\n<td>1x<\/td>\n<\/tr>\n<tr>\n<td>EqualityComparer&lt;string&gt;.Default<\/td>\n<td>33.5<\/td>\n<td>1.3x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.Ordinal<\/td>\n<td>29.8<\/td>\n<td>1.16x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.OrdinalIgnoreCase<\/td>\n<td>50.3<\/td>\n<td>1.95x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.OrdinalIgnoreCase non ASCII<\/td>\n<td>82.2<\/td>\n<td>3.19x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.CurrentCulture<\/td>\n<td>136<\/td>\n<td>5.27x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.CurrentCulture non ASCII<\/td>\n<td>174.3<\/td>\n<td>6.76x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.CurrentCultureIgnoreCase<\/td>\n<td>134.5<\/td>\n<td>5.21x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.CurrentCultureIgnoreCase non ASCII<\/td>\n<td>172.1<\/td>\n<td>6.67x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.InvariantCulture<\/td>\n<td>132.2<\/td>\n<td>5.12x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.InvariantCulture non ASCII<\/td>\n<td>189.5<\/td>\n<td>7.34x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.InvariantCultureIgnoreCase<\/td>\n<td>134.1<\/td>\n<td>5.2x<\/td>\n<\/tr>\n<tr>\n<td>StringComparer.InvariantCultureIgnoreCase non ASCII<\/td>\n<td>188<\/td>\n<td>7.29x<\/td>\n<\/tr>\n<\/table>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442 \u043a\u043e\u0434 \u2014 \u044f\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 string.Equals \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, GenericEqualityComparer&lt;string&gt; \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0412 OrdinalComparer \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0410 \u0434\u0430\u043b\u0435\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043d\u0435 \u0440\u0430\u0437\u043c\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0446\u0438\u043a\u043b\u044b, \u043b\u0438\u0431\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0432\u0435\u0434\u0443\u0442 \u0441\u0435\u0431\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043e\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 \u044f\u0434\u0440\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<h4>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u043d\u0430\u0434 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438<\/h4>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0430\u043a. \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u0440\u044f\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/mscorlib\/src\/System\/String.cs#L2516\">\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438<\/a>:  <\/p>\n<pre><code class=\"cs\">public Boolean StartsWith(String value) {     return StartsWith(value, StringComparison.CurrentCulture); } <\/code><\/pre>\n<p>  \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/mscorlib\/src\/System\/String.cs#L2133\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438<\/a> (\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435) \u0441\u043d\u043e\u0432\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u043e:  <\/p>\n<pre><code class=\"cs\">public bool Contains( string value ) {     return ( IndexOf(value, StringComparison.Ordinal) &gt;=0 ); } <\/code><\/pre>\n<p>  \u0410 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438, <a href=\"https:\/\/github.com\/dotnet\/coreclr\/blob\/bc146608854d1db9cdbcc0b08029a87754e12b49\/src\/mscorlib\/src\/System\/String.cs#L2269\">\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0435\u0440\u043d\u0451\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u044d\u0442\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438<\/a> \u2014 \u0441\u043d\u043e\u0432\u0430 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043e\u0439:  <\/p>\n<pre><code class=\"cs\">public int IndexOf(String value) {     return IndexOf(value, StringComparison.CurrentCulture); } <\/code><\/pre>\n<p>  LastIndexOf \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434. \u0427\u0442\u043e \u0432 \u043d\u0451\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442? \u0422\u043e\u043b\u044c\u043a\u043e \u0421\u0430\u0442\u044c\u044f \u0437\u043d\u0430\u0435\u0442. <\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434\u044b<\/h4>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439?   <\/p>\n<ul>\n<li>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 10%, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 string.Equals. <\/li>\n<li>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043b\u044e\u0447\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e Ascii-\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0447\u0442\u043e \u0434\u0430\u0441\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u043e\u043a\u043e\u043b\u043e 20% \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439. <\/li>\n<li>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0443\u0436\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b. \u0427\u0430\u0441\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043f\u0446\u0438\u044e StringComparer.InvariantCulture \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0430\u0432\u0442\u043e\u0440 \u0441\u0447\u0438\u0442\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u043c. \u041d\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c StringComparer.Ordinal \u0438\u043b\u0438, \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, StringComparer.OrdinalIgnoreCase.<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 String \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u0441 \u0436\u0434\u0451\u0442 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u00abTestString\u00bb \u0438 \u00abAnotherTestString\u00bb, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u0443\u0439\u0434\u0451\u0442 \u0432 production.<\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/274491\/\"> https:\/\/habrahabr.ru\/post\/274491\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0427\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c 2 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb397919.aspx\">LINQ to Objects<\/a>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f. <br \/>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u0432\u043d\u0430 O(n). \u041d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u043e \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u044d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438, <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb549267(v=vs.110).aspx\">\u0443\u043a\u0430\u0437\u0430\u0432 IEqualityComparer&lt;string&gt; \u044f\u0432\u043d\u043e<\/a>, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0431\u044b\u0441\u0442\u0440\u0435\u0435?  <\/p>\n<pre><code class=\"cs\">clients.Join(orders,                     c =&gt; c.Name,                     o =&gt; o.ClientName,                     (c, o) =&gt; CreateOrederDto(c, o)); <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b \u0435\u0451 \u044f\u0432\u043d\u043e?   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-273394","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273394"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273394\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}