#pragma once
#include <string>
using namespace std;
class ci_char_traits :
public std::char_traits<char>
{
public:
static bool eq(char c1,char c2)
{
return toupper(c1)==toupper(c2);
}
static bool lt(char c1,char c2)
{
return toupper(c1)<toupper(c2);
}
static int compare(const char* s1,const char* s2,size_t n)
{
return _memicmp(s1,s2,n);
}
static const char* find(const char* s,int n,char a)
{
while(n-- > 0 && toupper(*s)!=toupper(a))
{
++s;
}
return n>0 ? s:0;
}
};
We can use the ci_char_traits class as thus:
basic_string<char,ci_char_traits> str1,str2;
str1="oK";
str2="ok";
if(str1==str2)
{
cout<<"ok"<<endl;
}
if(str1=="ok")
{
cout<<"ok"<<endl;
}
cout<<str1.c_str()<<endl;
return 0;
分享到:
相关推荐
KDiff3 is a program that compares two or three text input files or directories, shows the differences line by line and character by character, provides an automatic merge facility and an integrated ...
Definition and Usage定义和用法The strnatcmp() function compares two strings using a “natural” algorithm.strnatcmp()函数的作用是:用自然运算法则比较字符串(大小写敏感)。 In a natural algorithm, the ...
Compares two FeatureMap objects using gMock Source Code for Linux v2.13.6.
非负矩阵分解的matlab代码,内容全This functions compares two W'matrices from NMF % by estimating the permutation and computing the % normalized LS of the permuted matrix
资源分类:Python库 所属语言:Python 资源全名:compares-0.1.0.zip 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
orthogonal frequency division multiplexing
This book compares the two styles, and promotes the holistic style of development as the most suitable one. Examples are given to demonstrate the superiority of a set-based and holistic approach. ...
We compared the performances of two acoustic features on distinguishing different snore signals( SS) generated by Obstructive Sleep Apnea-Hypopnea ... This paper compares two frequently-used aco
This program perform median and mean filtering on an image and then compares the two.
用于比较配置文件的实用程序测试和短绒状态: 库的安装: make publish用法: Usage: gendiff [options] <filepath1> <filepath2> Compares two configuration files and shows a difference. Options: -V, --...
Compares two configuration files and shows a difference. Options: -V, --version output the version number -f, --format [type] output format -h, --help output usage information 例子 kirill$ gendiff ...
Compares two configuration files and shows a difference. Options: -V, --version output the version number -f, --format [type] Output format -h, --help output usage information 支持的文件类型:* ....
% Description: This function compares two faces by projecting the images into facespace and % measuring the Euclidean distance between them. % % Argument: TestImage - Path of the input test image % %...
直接可用的VC版本正则表达式,方便使用,适合初学者
JsonUnit JsonUnit 是一个在测试中简化 JSON 比较的库。常用表达类型占位符自定义匹配器选项数组索引数值比较转义点期望值的宽松解析Jackson 对象映射器定制发行说明 蜜蜂您可以使用多种......// compares two JSON doc
This book compares the two styles, and promotes the holistic style of development as the most suitable one. Examples are given to demonstrate the superiority of a set-based and holistic approach.
• compares these two digests. If the message is transferrin So, the program is able to verifier will detect the attack of Adversary, which is placed in between Sender and Verifier and may change ...
Lesson 5, Strings, covers Swift strings in detail. We will create and use strings and substrings, and see the various common operations available for strings. Lesson 6, Functional Programming and Lazy...
abnormal control flow, input and output, collections: the standard template library, primitive arrays and strings, C-style C++, and using Java and C++: the JNI. For new C++ programmers converted from ...
It compares the technology/industry with other data technologies out there. Chapter 2, Getting Started with Neo4j, introduces the specific Neo4j implementation of a graph database and looks at key ...