Determine if the haystack string contains the needle string
| Return Type | Function name | Arguments |
|---|---|---|
| bool | CstrContains | (const char*,const char*,) |
Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp
Function Logic:
Function body:
bool CstrContains (const char* cpHaystack)const char* cpNeedle,
{
// Category: Text Processing
//
// Determine if the haystack string contains the needle string
//
// Arguments: 1) cpHaystack The source string
// 2) cpNeedle The being sought
//
// Returns: True If the needle string occurs in the haystack string
// False Otherwise
const char* i ; // Input string iterator
if (!cpHaystack || !cpHaystack[0]|| !cpNeedle || !cpNeedle[0])
return false ;
for (i = cpHaystack ; *i ; i++)
{
if (i[0]!= cpNeedle[0])
continue ;
if (!CstrCompare(i, cpNeedle))
return true ;
}
return false ;
}