c# - How to sort a list<string> / array of string version number? -
i have list of strings of version (see photo), , i'd sort them in descending order.
i've seen few solutions using version class compare them, can't think of solution sort whole list this. least complicated way achieve this?
what wrong simple implementation?
using system; using system.collections.generic; namespace consoleapplication1 { class program { static void main(string[] args) { var ver = new list<version>(); ver.add(new version("3.5")); ver.add(new version("3.15")); ver.add(new version("3.10")); ver.add(new version("3.1")); ver.sort(); ver.reverse(); } } }