By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,820 Members | 1,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,820 IT Pros & Developers. It's quick & easy.

string::compare

P: n/a
I've been trying to use std::string::compare and apparently it is case
sensitive, I searched the net but I can't find a way for it not to take case
into account, the solution I have for now is using stricmp with s1.c_str()
and s2.c_str() but I assume there is a better way... Thanks.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Flzw wrote:
I've been trying to use std::string::compare and apparently it is case
sensitive, I searched the net but I can't find a way for it not to take case
into account, [...]


Have you tried "case insensitive string comparison" on Google?
Jul 23 '05 #2

P: n/a
Flzw wrote:
I've been trying to use std::string::compare and apparently it is case
sensitive, I searched the net but I can't find a way for it not to
take case into account, the solution I have for now is using stricmp
with s1.c_str() and s2.c_str() but I assume there is a better way...
Thanks.
In your case, see http://www.boost.org/doc/html/iequals.html

From another thread:

Matthias wrote: Hello,

I am missing certain functionality of std::string, so I am currently
writing some helper functions which operate on strings. On of them is


Have you see Pavel Droba's string algorithm library at boost? See
http://www.boost.org/doc/html/string....html#id576916.

This offers an extensive set of well thought out algorithms. Boost is
extensively tested for portability across many platforms.

Jeff
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.