Re: Sorting nested lists with strings
- To: mathgroup at smc.vnet.net
- Subject: [mg116289] Re: Sorting nested lists with strings
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Thu, 10 Feb 2011 05:20:37 -0500 (EST)
Since you're sorting by the first element, just write
Sort@list
or
SortBy[list,First]
Bobby
On Wed, 09 Feb 2011 01:09:52 -0600, Paperorbifold
<kgodelNOSPAM at liberonospam.it> wrote:
> I've a nested list of this kind:
> list={{"Paul",23},{"Amanda",55},{"Carl",32},...}
> Suppose I want to perform an alphabetic sort on the first element. Which
> is
> the condition I've to write in Sort[list,...]?
> Actually Sort[list] automatically operates on the second element.
> Thanks.
>
--
DrMajorBob at yahoo.com