LoginSignup
1
1

More than 1 year has passed since last update.

Ruby—配列が別配列の要素を含むかどうかを判定する (配列同士を比較する)

Last updated at Posted at 2018-08-18
# Both arrays has :C value
([:A, :B, :C] & [:C, :D, :E]).size > 0
# => true

# Both array has no same value
([:A, :B, :C] & [:D, :E, :F]).size > 0
# => false

Versions

  • ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

Links

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1