add
This commit is contained in:
@@ -55,6 +55,15 @@ var renameCitys = [{"baiduCity": "阿克苏地区", "city": "阿克苏"},
|
||||
{"baiduCity": "延边朝鲜族自治州", "city": "延边"},
|
||||
{"baiduCity": "伊犁哈萨克自治州", "city": "伊犁"},
|
||||
{"baiduCity": "玉树藏族自治州", "city": "玉树州"}];
|
||||
String.prototype.startWith=function(str){
|
||||
var reg=new RegExp("^"+str);
|
||||
return reg.test(this);
|
||||
}
|
||||
|
||||
String.prototype.endWith=function(str){
|
||||
var reg=new RegExp(str+"$");
|
||||
return reg.test(this);
|
||||
}
|
||||
/**
|
||||
* 把百度的城市格式化成房价网的城市
|
||||
* @param baiduCity
|
||||
@@ -68,5 +77,8 @@ function formatBaiduCity(baiduCity) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (newCity == "" && baiduCity.endWith("市")) {
|
||||
newCity = baiduCity.substring(0,baiduCity.length-1);
|
||||
}
|
||||
return newCity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user