void main() {
var names = ["kevin", "peter", "david", "anna", "nilpointer"];
print("Ascending Order");
names.sort((i, j) => i.compareTo(j));
names.forEach((i) => {print(i)});
}
Output
Ascending Order
anna
david
kevin
nilpointer
peter