Home
C++
Bitset
Class
Console
Data Structure
Data Type
Deque
Development
File
Function
Generic
Language
List
Map Multimap
Overload
Pointer
Qt
Queue Stack
Set Multiset
STL Algorithms Binary search
STL Algorithms Heap
STL Algorithms Helper
STL Algorithms Iterator
STL Algorithms Merge
STL Algorithms Min Max
STL Algorithms Modifying sequence operations
STL Algorithms Non modifying sequence operations
STL Algorithms Sorting
STL Basics
String
Valarray
Vector
Menu
string compare « String « C++
C++
String
string compare
1.
String: equals
2.
string overloaded equality and relational operators
3.
Compare string ignoring the case
4.
Compare sub string: string4.compare( 0, string2.length(), string2 )
5.
Use == > and < to compare strings
6.
Use string.compare to compare two strings
7.
Compare strings by index: string1.compare( 2, 5, string3, 0, 5)
8.
Set with functor for string comparison
9.
return true if c1 < c2 (ignoring case), false otherwise
10.
Use std::lexicographical_compare to compare two char arrays
11.
Compare strings
12.
return true if c1 equals c2 (regardless of case), false otherwise