stricmp in STL

来源:互联网 发布:王者荣耀 世界观 知乎 编辑:程序博客网 时间:2024/06/06 18:05
inline bool nocase_compare (char c1, char c2){        return toupper(c1) == toupper(c2);}inline bool str_nocase_cmp(const std::string &str1, const std::string &str2){if(&str1 == &str2)return true;if(str1.size() != str2.size())return false;return std::equal(str1.begin(), str1.end(), str2.begin(), nocase_compare);};


0 0
原创粉丝点击