慕无忌1623718
//分段比较function version( v1, v2 ) { var arr1 = v1.replace(/[-_]/g,'.').split('.'); var arr2 = v2.replace(/[-_]/g,'.').split('.'); console.log(arr1,arr2); var len = Math.max(arr1.length, arr2.length); for ( var i = 0; i < len; i++ ) { if(parseInt(arr1[i]) == parseInt(arr2[i])) continue; return parseInt(arr1[i]) > parseInt(arr2[i]) ? true :false; } return false;}version('9_11_1','9_2_9');//trueversion('10.11.111','10.2.2');//true