当前位置:网站首页>* 比较版本号
* 比较版本号
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
}
边栏推荐
- 2022-08-01 反思
- Oracle数据类型介绍
- Win Go development kit installation configuration, GoLand configuration
- Service discovery of kubernetes
- 考完PMP学什么?前方软考等着你~
- The first time I wrote a programming interview question for Niu Ke: input a string and return the letter with the most occurrences of the string
- 【ORB_SLAM2】void Frame::AssignFeaturesToGrid()
- Reflex WMS Intermediate Series 7: What should I do if I want to cancel the picking of an HD that has finished picking but has not yet been loaded?
- 微信小程序异步回调函数恶梦和解决办法
- [Unity entry plan] 2D Game Kit: A preliminary understanding of the composition of 2D games
猜你喜欢
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
Ringtone 1161. Maximum In-Layer Elements and
Software testing Interface automation testing Pytest framework encapsulates requests library Encapsulates unified request and multiple base path processing Interface association encapsulation Test cas
Service discovery of kubernetes
忽晴忽雨
【Unity入门计划】2D Game Kit:初步了解2D游戏组成
Talking about the "horizontal, vertical and vertical" development trend of domestic ERP
FOFAHUB使用测试
【 wheeled odometer 】
【web】Understanding Cookie and Session Mechanism
随机推荐
记一个gorm初始化的坑
淘宝详情.
Nanoprobes纳米探针丨Nanogold偶联物的特点和应用
20. 用两个栈实现队列
【Unity入门计划】2D Game Kit:初步了解2D游戏组成
OC和Swift语言的区别
790. 数的三次方根
Rasa 3 x learning series - Rasa - 4873 dispatcher Issues. Utter_message study notes
Docker-compose安装mysql
2022河南青训联赛第(三)场
Good News | AR opens a new model for the textile industry, and ALVA Systems wins another award!
pyqt上手体验
PHP live source code to achieve simple barrage effect related code
列表常用方法
OC中new和init的区别
使用docker安装mysql
esp32经典蓝牙和单片机连接,,,手机蓝牙作为主机
Analysis of the status quo of digital transformation of manufacturing enterprises
Pinduoduo leverages the consumer expo to promote the upgrading of domestic agricultural products brands and keep pace with international high-quality agricultural products
C#测试项目中属性的用法