STL实现简单的忽略大小写字 符串比较
来源:互联网 发布:软件产品质量承诺 编辑:程序博客网 时间:2024/06/09 23:28
利用STL名字第二长的算法----lexicographical_compare
// 返回在忽略大小写的情况下c1是否在c2前面;
bool ciCharLess(char c1, char c2) {
tolower(static_cast<unsigned char>(c1)) <
tolower(static_cast<unsigned char>(c2));
}
bool ciStringCompare(const string& s1, const string& s2){
return lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(),
ciCharLess);
}
lexicographical_compare是strcmp的泛型版本
0 0
- STL实现简单的忽略大小写字 符串比较
- effective stl 第35条:通过mismatch和lexicographical_compare实现简单的忽略大小写的字符串比较
- c++忽略大小比较
- 忽略大小写比较字符串大小
- 忽略大小写比较字符串大小
- 忽略大小写,比较字符串大小。
- 宽字符串忽略大小写比较的实现
- OpenJudge 2721 忽略大小写比较字符串大小
- 简单的js比较时间的大小
- boost 的stl循环简单比较
- JS 日期比较大小的简单实例
- MNIST手写字识别的TensorFlow实现
- 比之前那个版本更简单的C语言实现的比较大小
- STL vector的简单实现
- STL 简单 allocator 的实现
- STL 简单 vector 的实现
- STL 简单 list 的实现
- STL 简单 deque 的实现
- Java并发编程:volatile关键字解析
- hdu 畅通工程(并查集)
- spring mvc+mybatis笔记(三)
- lua类的实现
- 34. Search for a Range--Array/LeetCode/C++
- STL实现简单的忽略大小写字 符串比较
- com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker - Cannot resolve com.mysq.jdbc.Connection.
- 分布式服务框架 Zookeeper -- 管理分布式环境中的数据
- 2016 icpc china final
- LeetCode-Array-1. Two Sum
- 解题报告:HDU 2196 Computer 简单树型DP
- HTML的学习
- ORACLE SEQUENCE(队列)用法
- NULL UNIQUE唯一约束