string::compare

Discussion in 'C++' started by Flzw, Jan 27, 2005.

  1. Flzw

    Flzw Guest

    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.
     
    Flzw, Jan 27, 2005
    #1
    1. Advertisements

  2. 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?
     
    Victor Bazarov, Jan 27, 2005
    #2
    1. Advertisements

  3. Flzw

    Jeff Flinn Guest

    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_algo/quickref.html#id576916.

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

    Jeff
     
    Jeff Flinn, Jan 27, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jrthor2

    help with string compare

    jrthor2, Apr 16, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    376
    jrthor2
    Apr 16, 2004
  2. =?Utf-8?B?YzY3NjIyOA==?=

    how compare object with string

    =?Utf-8?B?YzY3NjIyOA==?=, Feb 14, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    471
    Steven Cheng[MSFT]
    Feb 15, 2006
  3. Replies:
    10
    Views:
    838
  4. Replies:
    10
    Views:
    883
    Roland Pibinger
    Jan 24, 2007
  5. Replies:
    2
    Views:
    536
Loading...

Share This Page