toString

open override fun toString(): String

Convert version to string. Format is "major.minor.patch.build". build is omitted if null. patch is omitted if major is 12 or higher, patch is 0 and build is null. Sample output:

  • 1.0.0

  • 10.6.4

  • 10.7.0.0

  • 12.0


fun toString(parts: Int = 2): String

Convert version to string. Format is "major.minor.patch.build". The amount of parts returned is determined by parts and should be between 1 and 4 (inclusive). Defaults to 2 parts. Sample output:

  • 1.0.0

  • 10.6.4

  • 10.7.0.0

  • 12.0