C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

string::compare

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Flzw
Guest





PostPosted: Thu Jan 27, 2005 7:11 pm    Post subject: string::compare Reply with quote



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.


Back to top
Victor Bazarov
Guest





PostPosted: Thu Jan 27, 2005 7:12 pm    Post subject: Re: string::compare Reply with quote



Flzw wrote:
Quote:
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?

Back to top
Jeff Flinn
Guest





PostPosted: Thu Jan 27, 2005 7:18 pm    Post subject: Re: string::compare Reply with quote



Flzw wrote:
Quote:
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:
Quote:
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_algo/quickref.html#id576916.

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

Jeff



Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.