0
$\begingroup$

This question already has an answer here:

I often get Lists that contain a single item, like {name} or {{2,3,4}}.

Is there a function that simply takes the item out of the List without needing to use Part, like #[[1]]&?

$\endgroup$

marked as duplicate by Mr.Wizard May 11 '14 at 19:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Uh, isn't #[[1]]& a crude version of Part? The double bracket [[]] is a short version of Part, check a[[1]] // FullForm. $\endgroup$ – Gregory Rut May 11 '14 at 17:08
  • 1
    $\begingroup$ First ... Last... $\endgroup$ – Yves Klett May 11 '14 at 17:08
  • $\begingroup$ I intend to close this as a duplicate of (20180) unless you explain why it not the same. $\endgroup$ – Mr.Wizard May 11 '14 at 17:13
  • $\begingroup$ What's wrong with Part? It's a basic and very fast function. $\endgroup$ – m_goldberg May 11 '14 at 17:24
1
$\begingroup$

You can use First as in First@{{2,3,4}}. Not entirely sure though, why this should be preferable to [[1]].

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.