java 判斷是否大於指定版本號
阿新 • • 發佈:2018-10-10
ger class oop eat public result val split util
public boolean is_version_great_than(String version) { boolean result = false; if (!StringUtil.isNullorEmpty(version) && version.indexOf(".") >= 0) { String[] version_num = version.split("."); String[] cur_num = clientVersion.split(".");int loop_count = version_num.length; if (cur_num.length < version_num.length) { loop_count = cur_num.length; } for (int i = 0; i < loop_count; i++) { if (Integer.valueOf(version_num[i]) > Integer.valueOf(cur_num[i])) { result= true; break; } } } return result; }
java 判斷是否大於指定版本號