<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kan_kikuchi</author_name>
  <author_url>https://blog.hatena.ne.jp/kan_kikuchi/</author_url>
  <blog_title>(:3[kanのメモ帳]</blog_title>
  <blog_url>https://kan-kikuchi.hatenablog.com/</blog_url>
  <categories>
    <anon>Unity</anon>
    <anon>C#</anon>
    <anon>LINQ</anon>
    <anon>拡張メソッド</anon>
  </categories>
  <description>拡張メソッドとは LINQとは はじめに LINQには同じ値を取得するというメソッドはありますが、 //検索対象のList var list = new List&lt;int&gt;() { -11, 0, 5, 8, 24, 100 }; //Listの中から0を取得(なければデフォルト値) var targetValue = list.FirstOrDefault(value =&gt; value == 0); 一番近い値を取得するメソッドはありません。 と言う事で今回は任意の値に最も近い値を取得するLINQの拡張メソッド を作ってみようという感じの記事です！ なお、Unityでの使用を想定しているため…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkan-kikuchi.hatenablog.com%2Fentry%2FLINQ_Nearest&quot; title=&quot;任意の値に最も近い値を取得するLINQの拡張メソッド【Unity】【C#】【LINQ】【拡張メソッド】 - (:3[kanのメモ帳]&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>https://cdn-ak.f.st-hatena.com/images/fotolife/k/kan_kikuchi/20220226/20220226074627.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-03-03 08:06:03</published>
  <title>任意の値に最も近い値を取得するLINQの拡張メソッド【Unity】【C#】【LINQ】【拡張メソッド】</title>
  <type>rich</type>
  <url>https://kan-kikuchi.hatenablog.com/entry/LINQ_Nearest</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
