比较不考虑案例 [英] Compare without regard to case
问题描述
Haven无法找到这样的东西。
任何人都可以告诉我一个标准C ++函数
比较两个字符串没有关于案件。两者都是
使用char *和std :: string。
谢谢,
-JKop
Haven''t been able to find such a thing.
Can anyone please inform me of a Standard C++ function for
comparing two strings without regard to case. Both for
working with "char*", and with "std::string".
Thanks,
-JKop
推荐答案
" JKop" < NU ** @ NULL.NULL> schrieb im Newsbeitrag
新闻:ab ****************** @ news.indigo.ie ...
"JKop" <NU**@NULL.NULL> schrieb im Newsbeitrag
news:ab******************@news.indigo.ie...
Haven找不到这样的东西。
任何人都可以告诉我一个标准的C ++函数来比较两个字符串而不考虑大小写。两者都用于
使用char *和std :: string。
Haven''t been able to find such a thing.
Can anyone please inform me of a Standard C++ function for
comparing two strings without regard to case. Both for
working with "char*", and with "std::string".
stricmp(str1,str2);
stricmp(str1, str2);
" JKop" < NU ** @ NULL.NULL>在消息中写道
"JKop" <NU**@NULL.NULL> wrote in message
Haven无法找到这样的东西。
任何人都可以告诉我标准C ++函数
比较两个字符串而不考虑大小写。两者都用于
使用char *和std :: string。
Haven''t been able to find such a thing.
Can anyone please inform me of a Standard C++ function for
comparing two strings without regard to case. Both for
working with "char*", and with "std::string".
一种方法是从char_traits<继承。 ..>并提供必要的
覆盖。然后使用该类而不是std :: string。这在GotW系列中讨论了
- http: //www.gotw.ca/gotw/029.htm
Sharad
One way is to inherit from char_traits<...> and provide the necessary
overrides. Then use that class instead of std::string. This is discussed in
this GotW series - http://www.gotw.ca/gotw/029.htm
Sharad
" ; Gernot Frisch < Me@Privacy.net>在消息中写道
news:2q ************* @ uni-berlin.de ...
"Gernot Frisch" <Me@Privacy.net> wrote in message
news:2q*************@uni-berlin.de...
" JKop" < NU ** @ NULL.NULL> schrieb im Newsbeitrag
新闻:ab ****************** @ news.indigo.ie ...
"JKop" <NU**@NULL.NULL> schrieb im Newsbeitrag
news:ab******************@news.indigo.ie...
Haven没有去过能找到这样的东西。
任何人都可以告诉我一个标准的C ++函数来比较两个字符串而不考虑大小写。两者都用于
使用char *和std :: string。
Haven''t been able to find such a thing.
Can anyone please inform me of a Standard C++ function for
comparing two strings without regard to case. Both for
working with "char*", and with "std::string".
stricmp(str1,str2);
stricmp(str1, str2);
stricmp不是标准的C或C ++。
john
stricmp is not standard C or C++.
john
这篇关于比较不考虑案例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!