Possible Duplicate:
How do you compare two version Strings in Java?
I’ve 2 strings which contains version information as shown below:
str1 = "1.2"
str2 = "1.1.2"
Now, can any one tell me the efficient way to compare these versions inside strings in Java & return 0 , if they’re equal, -1, if str1 < str2 & 1 if str1>str2.
Requires commons-lang3-3.8.1.jar for string operations.