Add strcmpIgnore func.

This commit is contained in:
shenweip
2013-11-18 23:45:44 +08:00
parent daffc235b8
commit cfeb918033
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -233,4 +233,10 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
pos += dest.size();
}
return result;
}
int strcmpIgnore(std::string str1, std::string str2, std::string ignorestr1, std::string ignorestr2) {
str1 = ReplaceAll(str1, ignorestr1, ignorestr2);
str2 = ReplaceAll(str2, ignorestr1, ignorestr2);
return strcmp(str1.c_str(),str2.c_str());
}