IntersectingQ

IntersectingQ[list1,list2]

yields True if list1 and list2 have at least one element in common, and False otherwise.

Details and Options

  • IntersectingQ works for expressions with heads other than List.
  • When applied to associations, IntersectingQ compares their values.
  • IntersectingQ[list1,list2,SameTesttest] applies test to each pair of elements in the listi to determine whether they should be considered the same.

Examples

Basic Examples  (1)

Test whether lists share any elements:

Wolfram Research (2014), IntersectingQ, Wolfram Language function, https://reference.wolfram.com/language/ref/IntersectingQ.html (updated 2022).

Text

Wolfram Research (2014), IntersectingQ, Wolfram Language function, https://reference.wolfram.com/language/ref/IntersectingQ.html (updated 2022).

CMS

Wolfram Language. 2014. "IntersectingQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/IntersectingQ.html.

APA

Wolfram Language. (2014). IntersectingQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IntersectingQ.html

BibTeX

@misc{reference.wolfram_2024_intersectingq, author="Wolfram Research", title="{IntersectingQ}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/IntersectingQ.html}", note=[Accessed: 23-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_intersectingq, organization={Wolfram Research}, title={IntersectingQ}, year={2022}, url={https://reference.wolfram.com/language/ref/IntersectingQ.html}, note=[Accessed: 23-November-2024 ]}