doc: french doc "développez en Nit"
[nit.git] / doc / developpez / modules / listings / sorter1_c.nit
diff --git a/doc/developpez/modules/listings/sorter1_c.nit b/doc/developpez/modules/listings/sorter1_c.nit
new file mode 100644 (file)
index 0000000..30a6c11
--- /dev/null
@@ -0,0 +1,9 @@
+var tab = ["a", "c", "b"] # Un tableau non trié
+
+print tab # acb
+
+var sorter = new ComparableSorter[String] # On instancie le sorter ComparableSorter en précisant le type que l'on veut trier, ici des String
+
+sorter.sort(tab) # On trie le tableau
+
+print tab # abc