compareVersions method

int compareVersions(
  1. String a,
  2. String b
)

Compare two versions.

Returns a negative value if a < b, zero if equal, and a positive value if a > b.

Implementation

int compareVersions(String a, String b) {
  return Version.parse(a).compareTo(Version.parse(b));
}