当前位置:网站首页>* 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
}
边栏推荐
- Recursively check if a configuration item has changed and replace it
- 【LeetCode】104.二叉树的最大深度
- node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module ‘./scope‘
- 灰度传感器、、、diy原理。。图
- What to study after the PMP exam?The soft exam ahead is waiting for you~
- VPS8505 微功率隔离电源隔离芯片 2.3-6V IN /24V/1A 功率管
- 2022牛客多校三_F G
- Oracle数据类型介绍
- 局部敏感哈希:如何在常数时间内搜索Embedding最近邻
- 数值积分方法:欧拉积分、中点积分和龙格-库塔法积分
猜你喜欢
随机推荐
2022 NPDP take an examination of how the results?How to query?
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
OperatingSystemMXBean获取系统性能指标
isa指针使用详情
FOFAHUB使用测试
考完PMP学什么?前方软考等着你~
面对职场“毕业”,PM&PMO应该如何从容的应对?如何跳槽能够大幅度升职加薪?
Nanoprobes多组氨酸 (His-) 标签标记:重组蛋白检测方案
IMU预积分的简单理解
架构:微服务网关(SIA-Gateway)简介
菜刀webshell特征分析
FOFAHUB usage test
20. 用两个栈实现队列
JVM调优实战
简单的页面跳转活动
How ReentrantLock works
cadence landscape bindkey
工程师如何对待开源
cocos中使用async await异步加载资源
aws s3 upload file