473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

string::compare

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
2 2212
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nasos Makriyiannis | last post by:
Hi, I'm new to XSL and I was wondering if there is a string-compare function available. I am using the following IF statement but it does not seem to be working: <xsl:if...
19
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I...
0
by: jrthor2 | last post by:
I have a .net application that is using microsofts locator service. I have this working, but when I select a user to locate from my contact list, it comes back with a map, but the pushpin has the...
3
by: gerards_ | last post by:
Hi all, What I am trying to do is to String Compare just the first 6 characters of a string. For example: For the compare string "Powama" I want to return true for any strings that...
6
by: Maileen | last post by:
Hi, I have the following code : Function GetRequestType(ByVal EvDt As String, ByVal StPeriod As String, ByVal EdPeriod As String, ByVal TaskType As String) As Integer Dim strtest As String Dim...
6
by: Gwyn | last post by:
If I test "A+" > "A-" then I get true If I test "A+A" > "A-A" then I get false What the hell is going on?! I can only imagine it's down to culture... but why? my thread culture setting is...
10
by: lchian | last post by:
Hi, For two stl strings s1 and s2, I got different results from strcmp(s1.c_str(), s2.c_str()) and s1.compare(s2) can someone explain what these functions do? It seems that strcmp gives...
4
by: Jim Langston | last post by:
Is there any builtin lowercase std::string compare? Right now I'm doing this: if ( _stricmp( AmmoTypeText.c_str(), "GunBullet" ) == 0 ) AmmoType = Item_Ammo_GunBullet; Is there anything the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.