当前位置:网站首页>* Compare version numbers
* Compare version numbers
2022-08-02 02:46:00 【Diba LZTXDY】
/*** Compare version numbers*/private fun checkVersion(upgradedVersion: String): Int {
val nums1: Array = upgradedVersion.split(“\.”.toRegex()).toTypedArray()
val nums2: Array = checkVersionName.split(“\.”.toRegex()).toTypedArray()
val n1 = nums1.size
val n2 = nums2.size
for (i in 0 until Math.max(n1, n2)) {
val num1 = if (i < n1) nums1[i].toInt() else 0
val num2 = if (i < n2) nums2[i].toInt() else0
if (num1 != num2) {
return if (num1 < num2) 0 else 1
}
}
return 0
}
边栏推荐
猜你喜欢
随机推荐
数仓:数仓从ETL到ELT架构的转化以及俩者的区别
yaml
Nanoprobes丨1-mercapto-(triethylene glycol) methyl ether functionalized gold nanoparticles
Talking about the "horizontal, vertical and vertical" development trend of domestic ERP
Nacos源码分析专题(一)-环境准备
Recursively check if a configuration item has changed and replace it
2022牛客多校四_G M
详解最强分布式锁工具:Redisson
NIO's Sword
ros多客户端请求服务
考完PMP学什么?前方软考等着你~
使用docker安装mysql
mysql 查看死锁
【LeetCode】206.反转链表
53. 最小的k个数
非稳压 源特电子 隔离电源模块芯片 5W VPS8504B 24V
【LeetCode】144.二叉树的前序遍历
Tree Chain Segmentation-
国标GB28181协议EasyGBS平台兼容老版本收流端口的功能实现
OC中成员变量,实例变量和属性之间的区别和联系









