由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - compare string ignore case
相关主题
store "" in c stringwhitespace 问题
node- mongoose的思考C++ Strategies and Tactics 书上一个问题求助
python 小问题抠字眼:assignment and initialize in C++
What's problem with this piece of code using stl map?再问两个C++问题
很困惑的javascript string compare问题问个C++的String问题
哪儿有经典的C++ programing 习题集嘛?问一个sort的问题
Question about 求助:Visual C++ 2005 Express
C++ string类输入数据的问题C++一个string的小问题
相关话题的讨论汇总
话题: string话题: ignore话题: compare话题: uppercase话题: lowercase
进入Programming版参与讨论
1 (共1页)
c*******9
发帖数: 6411
1
what is the best way to compare string ignore case? I did not find an
method in the string class doing that, do I still need to use c to convert
the character to all lowercase or uppercase?
d****p
发帖数: 685
2
I remember I posted the same question before.
The fastest (not necessarily the best) way is to set up a look up table T
such that T[uppercase(char)] = T[lowercase(char)].
a****o
发帖数: 686
3
tolower(char c)
C++ and C both have a version of tolower, do not mix them.
most likely, you will need a template to wrap it if you have to include
stdio.h in C++.
t****u
发帖数: 8614
4
stricmp()

【在 c*******9 的大作中提到】
: what is the best way to compare string ignore case? I did not find an
: method in the string class doing that, do I still need to use c to convert
: the character to all lowercase or uppercase?

N***m
发帖数: 4460
5
then use string's c_str() function first

【在 t****u 的大作中提到】
: stricmp()
1 (共1页)
进入Programming版参与讨论
相关主题
C++一个string的小问题很困惑的javascript string compare问题
C++ string to int Problem哪儿有经典的C++ programing 习题集嘛?
what does string^ str mean?Question about
VC++ 6.0 弱问,多谢解答C++ string类输入数据的问题
store "" in c stringwhitespace 问题
node- mongoose的思考C++ Strategies and Tactics 书上一个问题求助
python 小问题抠字眼:assignment and initialize in C++
What's problem with this piece of code using stl map?再问两个C++问题
相关话题的讨论汇总
话题: string话题: ignore话题: compare话题: uppercase话题: lowercase