<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>thinca</author_name>
  <author_url>https://blog.hatena.ne.jp/thinca/</author_url>
  <blog_title>永遠に未完成</blog_title>
  <blog_url>https://thinca.hatenablog.com/</blog_url>
  <categories>
    <anon>C#</anon>
    <anon>trap</anon>
  </categories>
  <description>C#(mono 2.10.9) で、特定の値を先頭に持ってきつつソート、というのをしようとした。 こんな感じかなー。 var list = new List&lt;int&gt;{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int t = 5; // 5 を先頭に持って行きたい list.Sort((a, b) =&gt; { if (a == t) return -1; if (b == t) return 1; return a.CompareTo(b); }); Console.WriteLine(string.Join(&quot;, &quot;, list)); 1, 5, 2, 3, 4, 6, …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fthinca.hatenablog.com%2Fentry%2F20130330%2F1364586032&quot; title=&quot; C# のソートでハマった話 - 永遠に未完成&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-03-30 04:40:32</published>
  <title> C# のソートでハマった話</title>
  <type>rich</type>
  <url>https://thinca.hatenablog.com/entry/20130330/1364586032</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
