<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>round-rand</author_name>
  <author_url>https://blog.hatena.ne.jp/round-rand/</author_url>
  <blog_title>ランドML</blog_title>
  <blog_url>https://ml-rand-note.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>uniq：重複した要素を除去した配列を作成 compact：nilを削除した配列を作成 select(filter)：条件を満たす要素を抽出 参考 uniq：重複した要素を除去した配列を作成 uniqは重複した要素を除去した配列を返します。 uniq!なら破壊的に除去をし、 削除あり ⇒ 配列 削除なし ⇒ nil を返します。 ary = [1, 3, 2, 2, 3] # uniqは元の配列はそのまま p ary.uniq #=&gt; [1, 3, 2] p ary #=&gt; [1, 3, 2] # uniq!は元の配列を更新(破壊的) p ary.uniq! #=&gt; [1, 3, 2] p a…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fml-rand-note.hatenablog.com%2Fentry%2Fruby%2Farray-uniq-compact-select&quot; title=&quot;【Ruby】配列 削除・抽出メソッドまとめ(uniq, compact, select, filter) - ランドML&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>2026-07-02 00:00:00</published>
  <title>【Ruby】配列 削除・抽出メソッドまとめ(uniq, compact, select, filter)</title>
  <type>rich</type>
  <url>https://ml-rand-note.hatenablog.com/entry/ruby/array-uniq-compact-select</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
