Mastering Development

Java program to sort a versioning string in an ascending order

I have a list containing version strings, such as things:

versions_list = ["1.1.2", "1.0.0", "1.3.3", "1.0.12", "1.0.2"]
I would like to sort it, so the result would be something like this:

versions_list = ["1.0.0", "1.0.2", "1.0.12", "1.1.2", "1.3.3"]
How to do this in Java.

Leave a Reply

Your email address will not be published. Required fields are marked *