flex比较ip地址
程序员文章站
2022-05-28 14:14:58
...
//比较IP地址大小 endIp>startIp 返回true 否则返回false
private function compareIP(startIp:String,endIp:String):Boolean{
var flag:Boolean=false;
var startIps:Array=startIp.split("\.");
var endIps:Array=endIp.split("\.");
for(var i:int=0;i<startIps.length;i++){
if(int(endIps[i])>int(startIps[i])){
flag=true;
break;
}else{
if(int(endIps[i])==int(startIps[i])){
continue;
}else{
break;
}
}
}
return flag;
}