Is there is a way to sort 2D array based on one field ?
Mine is an array Card(suit, rank). I want to sort it based on rank.
priyanka85
0
Newbie Poster
Recommended Answers
Jump to PostSure is, just add the interface IComparable to your Card class, then use the build in Array.Sort.
Jump to PostMemorath, how would you do that what you said? Would like to see that too.
Jump to PostHmm...apperantly code tags have changed. There no syntax highlighting and I can't edit my post :S
All 9 Replies
Momerath
1,327
Nearly a Senior Poster
Featured Poster
priyanka85
0
Newbie Poster
Mitja Bonca
557
Nearly a Posting Maven
Momerath
1,327
Nearly a Senior Poster
Featured Poster
thines01
401
Postaholic
Team Colleague
Featured Poster
Mitja Bonca
557
Nearly a Posting Maven
Momerath
1,327
Nearly a Senior Poster
Featured Poster
skatamatic
371
Practically a Posting Shark
skatamatic
371
Practically a Posting Shark
Dani
commented:
Your post looks fine to me.
+13
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.