当前位置:网站首页>* 比较版本号
* 比较版本号
2022-08-02 02:33:00 【迪霸LZTXDY】
/**
* 比较版本号
*/
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() else 0
if (num1 != num2) {
return if (num1 < num2) 0 else 1
}
}
return 0
}
边栏推荐
猜你喜欢
[Server data recovery] Data recovery case of server Raid5 array mdisk disk offline
Flask入门学习教程
2022-08-01 mysql/stoonedb slow SQL-Q18 analysis
BI - SQL 丨 WHILE
Analysis of the status quo of digital transformation of manufacturing enterprises
【Unity入门计划】2D Game Kit:初步了解2D游戏组成
工程师如何对待开源
永磁同步电机36问(三)——SVPWM代码实现
Safety (2)
CASE2023
随机推荐
Use DBeaver for mysql data backup and recovery
C#测试项目中属性的用法
leetcode / anagram in string - some permutation of s1 string is a substring of s2
[Unity entry plan] 2D Game Kit: A preliminary understanding of the composition of 2D games
项目场景 with ERRTYPE = cudaError CUDA failure 999 unknown error
How to adjust the cross cursor too small, CAD dream drawing calculation skills
53. 最小的k个数
很有意思的经历,很有意思的项目--文件夹对比工具
KICAD 小封装拉线卡顿问题 解决方法
Curriculum Vitae;CV
罗德里格斯公式(Rodrigues‘ Rotation Formula)推导
isa指针使用详情
使用docker安装mysql
永磁同步电机36问(三)——SVPWM代码实现
NIO‘s Sword(牛客多校赛)
2022年NPDP考完多久出成绩?怎么查询?
菜刀webshell特征分析
JS中获取对象数据类型的键值对的键与值
AWR分析报告问题求助:SQL如何可以从哪几个方面优化?
openGauss切换后state状态显示不对