SortedList in C# is nice...
Submitted by matthias hub on Mon, 04/26/2010 - 10:32
Just found this class while looking for a automatically alphabetically sorted-by-key hashtable (from http://msdn.microsoft.com/en-us/library/system.collections.sortedlist.aspx):
using System;
using System.Collections;
public class SamplesSortedList {
public static void Main() {
// Creates and initializes a new SortedList.
SortedList slides = new SortedList();
slides.Add("0", "slide1");
slides.Add("2", "slide3");
slides.Add("1", "slide2");
// Displays the properties and values of the SortedList.
for (int i = 0; i < slides.Count; i++) {
Console.WriteLine("{0}:{1}", slides.GetKey(i), slides.GetByIndex(i));
}
Console.WriteLine();
}
Navigation
User login
matthias hub's tweets
- schöne kleine Anleitung: stefanglase.de | Gradle unter Mac OS X installieren: http://t.co/iAtn1HC7 — 9 weeks 5 days ago
- @wespennest haste pingelsn nicht gesehen? — 11 weeks 6 days ago
- Nu hats tatsächlich geklappt, freie Plätze für uns! (@ Champa Thai-Lao-Imbiss) http://t.co/7h9dBaRn — 12 weeks 1 day ago
- Wow, jetzt erst geht es weiter mit der Fahrt... #A81 — 13 weeks 5 days ago
- So, und im nächsten Stau: Vollsperrung auf der A81 aufgrund eines Unfalls mit einem Gefahrguttransporter... müde... — 13 weeks 5 days ago
- 1 of 65
- ››
