Compare two hzString instances, ignore case.
| Return Type | Function name | Arguments |
|---|---|---|
| int32_t | StringCompareI | (hzString&,hzString&,) |
Declared in file: hzString.h
Defined in file : hzString.cpp
Function Logic:
Function body:
int32_t StringCompareI (hzString& A)hzString& B,
{
// Category: Text Processing
//
// Compare two hzString instances, ignore case.
//
// Arguments: 1) A First test string
// 2) B Second test string
//
// Returns: <0 If A is lexically less than B
// >0 If A is lexically more than B
// 0 If A abs B are eqivelent.
_hzfunc(__func__) ;
const char* t = *A ; // Pointer to string A value
const char* s = *B ; // Pointer to string B value
if (!t)
return (!s || !s[0])? 0: -_tolower(*s) ;
if (!s || !s[0])
return _tolower(*t) ;
for (; *t && *s && _tolower(*t) == _tolower(*s) ; t++, s++) ;
return _tolower(*t) - _tolower(*s) ;
}