blob: 61769c9df45043ba419ec76df23a559f3b4b1c14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include "util/StringUtils.hpp"
#include <algorithm>
#include <cctype>
using namespace std;
bool stringicasecmp( const string &s1, const string &s2 )
{
string::const_iterator i1 = s1.begin( ), e1 = s1.end( ),
i2 = s2.begin( ), e2 = s2.end( );
while( i1 != e1 && i2 != e2 ) {
if( toupper( *i1 ) != toupper( *i2 ) ) return false;
i1++;
i2++;
}
if( i1 == e1 && i2 == e2 ) return true;
return false;
}
|