Connecting Tech Pros Worldwide Forums | Help | Site Map

strnicmp in stl string class?

JustSomeGuy
Guest
 
Posts: n/a
#1: Jul 22 '05
What is the equivilent of strnicmp in the stl string class...
ie i want to do a case independant comparison of the first n characters.



John Harrison
Guest
 
Posts: n/a
#2: Jul 22 '05

re: strnicmp in stl string class?



"JustSomeGuy" <nope@nottelling.com> wrote in message
news:TiO3d.462745$M95.157514@pd7tw1no...[color=blue]
> What is the equivilent of strnicmp in the stl string class...
> ie i want to do a case independant comparison of the first n characters.
>[/color]

There is no case independent comparison in the STL string class. Neither is
strnicmp or any other similar function part of standard C++.

If you want to do case independent comparison you will have to do it
yourself. You could use the character functions toupper and tolower for this
purpose.

john


David Fisher
Guest
 
Posts: n/a
#3: Jul 22 '05

re: strnicmp in stl string class?


JustSomeGuy wrote:
[color=blue]
> What is the equivilent of strnicmp in the stl string class...
> ie i want to do a case independant comparison of the first n characters.[/color]

See the recent thread in this news group:

From: "JKop"
Subject: "Compare without regard to case"
Posted Wednesday, 15 September 2004 10:02 PM

David Fisher
Sydney, Australia


Closed Thread