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]]&?
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]]&?
You can use First as in First@{{2,3,4}}. Not entirely sure though, why this should be preferable to [[1]].
a[[1]] // FullForm. – Grzegorz Rut May 11 '14 at 17:08First...Last... – Yves Klett May 11 '14 at 17:08Part? It's a basic and very fast function. – m_goldberg May 11 '14 at 17:24