On May 3, 6:16 am, KFUPM <hussain.alqaht... at gmail.com> wrote:
> Dear All
>
> I have a list and i need to test whether all the elements in the list
> are identical or no. What is the efficient way to do that? The output
> should be true if all elements are the same and False otherwise. One
> line command is preferred if possible.
>
> Your help is highly appreciated.
>
> Regards,
>
> HMQ
I'd like to retract that suggestion of PatternSequence. It doesn't
work.
MatchQ[{q, 1, q, q}, PatternSequence[_]]
True
JM